index.js
function(name, force, callback) {
    var err = null;
    var profiles = this.all();

    if (~profiles.indexOf(name)) {
      err = 'Profile "' + name + '" already exists.';

    } else if (!force && ~RESERVED_PROFILE_NAME.indexOf(name)) {
      err = 'Profile name "' + name + '" is reserved by `multi-profile`';

    } else if (/^_/.test(name)) {
      err = 'Profile name "' + name + '" should not begin with `_`';

    } else {
      profiles.push(name);
      this.attr.set('profiles', profiles);
    }

    var data = {
      err: err,
      name: name
    };
    this.emit('add', data);

    callback && callback(err, data);
  }
function(name, force, callback) {
    var err = null;
    var profiles = this.all();

    if (~profiles.indexOf(name)) {
      err = 'Profile "' + name + '" already exists.';

    } else if (!force && ~RESERVED_PROFILE_NAME.indexOf(name)) {
      err = 'Profile name "' + name + '" is reserved by `multi-profile`';

    } else if (/^_/.test(name)) {
      err = 'Profile name "' + name + '" should not begin with `_`';

    } else {
      profiles.push(name);
      this.attr.set('profiles', profiles);
    }

    var data = {
      err: err,
      name: name
    };
    this.emit('add', data);

    callback && callback(err, data);
  }
function ( name , force , callback ) { var err = null ; var profiles = this . all ( ) ; if ( ~ profiles . indexOf ( name ) ) { err = 'Profile "' + name + '" already exists.' ; } else if ( ! force && ~ RESERVED_PROFILE_NAME . indexOf ( name ) ) { err = 'Profile name "' + name + '" is reserved by `multi-profile`' ; } else if ( / ^_ / . test ( name ) ) { err = 'Profile name "' + name + '" should not begin with `_`' ; } else { profiles . push ( name ) ; this . attr . set ( 'profiles' , profiles ) ; } var data = { err : err , name : name } ; this . emit ( 'add' , data ) ; callback && callback ( err , data ) ; }
Add a new profile. Adding a profile will not do nothing about initialization
Add a new profile . Adding a profile will not do nothing about initialization