src/lib/modules/themes/index.js
/**
   * Change active theme
   * @param {string} themeName - Name of the theme to change to
   */
Change active theme
@param {string} themeName - Name of the theme to change to
Change active theme @param { string } themeName - Name of the theme to change to
changeActive(themeName) {
    var _this = this;
    var newActiveTheme;
    if (!themeName) return Promise.reject(new Error('theme - changeActive() - themeName is required'));
    return _this.list()
      .then((themes) => {
        return new Promise((resolve, reject) => {
          newActiveTheme = _.findWhere(themes, {
            name: themeName
          });
          if (!newActiveTheme) return reject(new Error(`theme - changeActive() - ${themeName} is not a valid theme`));
          themes = themes.map(theme => {
            theme.active = false;
            return theme;
          });
          newActiveTheme.active = true;
          return resolve(themes);
        });
      })
      .then(writeThemesFile)
      .then(readThemesFile)
      .then(() => {
        return new Promise((resolve) => {
          return resolve(newActiveTheme);
        });
      });
  }
changeActive ( themeName ) { var _this = this ; var newActiveTheme ; if ( ! themeName ) return Promise . reject ( new Error ( 'theme - changeActive() - themeName is required' ) ) ; return _this . list ( ) . then ( ( themes ) => { return new Promise ( ( resolve , reject ) => { newActiveTheme = _ . findWhere ( themes , { name : themeName } ) ; if ( ! newActiveTheme ) return reject ( new Error ( ` ${ themeName } ` ) ) ; themes = themes . map ( theme => { theme . active = false ; return theme ; } ) ; newActiveTheme . active = true ; return resolve ( themes ) ; } ) ; } ) . then ( writeThemesFile ) . then ( readThemesFile ) . then ( ( ) => { return new Promise ( ( resolve ) => { return resolve ( newActiveTheme ) ; } ) ; } ) ; }
Change active theme
 @param {string} themeName - Name of the theme to change to
Change active theme @param { string } themeName - Name of the theme to change to