each(commands, (commandPath, commandName) => { // Don't fetch aliases for help commands to keep the output clean. bootstrap.loadCommand(commandName, commandPath, yargs, [], extensions); });
/** * Gets a list of the available process managers from all of the extensions * * @return {Object} hash of all process managers indexed by name * @method _getAvailableProcessManagers * @private */ _getAvailableProcessManagers() { const available = {}; this._extensions.forEach((ext) => { each(ext.processManagers, (pm, name) => { if (!fs.existsSync(pm)) { return; } available[name] = pm; }); }); return available; }
function showDetails(ui, results, error) { ui.log(chalk.bold.red(`\n${error ? 'Errors' : 'Warnings'}`)); each(results, (list, fileName) => { /* istanbul ignore if */ if (!list.length) { return; } const details = list.map((result) => { if (error && result.fatal) { return `${SPACES}- ${chalk.bold.red('Fatal error:')} ${result.rule.replace(TAGS_REGEX, '')}`; } return `${SPACES}- ${result.rule.replace(TAGS_REGEX, '')}`; }).join('\n'); ui.log(`${chalk.bold.white(`${SPACES}File:`)} ${chalk.white(fileName)}\n${details}\n`); }); }
/** * Configure Yargs for this command. Subclasses can override this to do anything * specific that they need to do at config time * * @param {String} commandName Name of the command * @param {Yargs} yargs Yargs instance * @param {Array} extensions Array of discovered extensions * @return {Yargs} Yargs instance after options are configured * * @static * @method configureOptions * @public */ static configureOptions(commandName, yargs, extensions, onlyOptions) { each(this.options || {}, (option, optionName) => { yargs = yargs.option(kebabCase(optionName), option); }); if (onlyOptions) { return yargs; } if (this.longDescription) { yargs.usage(this.longDescription); } yargs.epilogue('For more information, see our docs at https://ghost.org/docs/api/ghost-cli/'); return yargs; }
each(this._overrides, (ov, ns) => { if (ns !== name && overrideMap.others.indexOf(ns) >= 0 && ov.others.indexOf(name) >= 0) { throw new Error(`circular namespace override between '${name}' and '${ns}'`); each(this._overrides, v => (v.value = v.initValue)); do { done = true; each(this._overrides, ov => { if (ov.others.length === 0) return; const max = ov.others.reduce(
each(omitFields(data), (value, key) => {