async getAllInstances(running) {
        const instances = this.globalConfig.get('instances', {});
        const names = Object.keys(instances);

        const namesToRemove = [];

        // Remove nonexistent instances
        const result = names.map((name) => {
            if (!fs.existsSync(path.join(instances[name].cwd, '.ghost-cli'))) {
                namesToRemove.push(name);
                return null;
            }

            return this.getInstance(name);
        }).filter(Boolean);

        if (namesToRemove.length) {
            namesToRemove.forEach(name => delete instances[name]);
            this.globalConfig.set('instances', instances).save();
        }

        // If we're not filtering out stopped instances, just return the result
        if (!running) {
            return result;
        }

        // Return the result filtered by whether or not the instance is running
        const filtered = [];
        for (let instance of result) {
            if (await instance.isRunning()) {
                filtered.push(instance);
            }
        }
        return filtered;
    }
Gets all listed instances. If running is true, returns only running instances
Also removes any instances that no longer exist

@param {Boolean} running If true, returns only running instances
@return {Promise<Instance>} instances
@method getAllInstances
@public