addInstance(instance) {
        const instances = this.globalConfig.get('instances', {});
        const existingInstance = findKey(instances, cfg => cfg.cwd === instance.dir);

        if (existingInstance) {
            instance.name = existingInstance;
            return;
        }

        let currentName = instance.name;
        const existingNames = Object.keys(instances);
        // Loop through the names, incrementing it by 1 each time until
        // we hit one that doesn't already exist
        while (existingNames.includes(currentName)) {
            currentName = uniqueId(currentName.match(/-\d+$/) ? currentName.replace(/-\d+$/, '-') : `${currentName}-`);
        }

        // Only change the instance name if we ended up needing to de-duplicate
        if (currentName !== instance.name) {
            instance.name = currentName;
        }

        this.globalConfig.set(`instances.${currentName}`, {cwd: instance.dir}).save();
    }
Adds an instance to the global instance list. Also
de-duplicates the process name

@param {Instance} Instance to add
@method addInstance
@public