setInterval(() => { const pre = lineBreak(2) + spacing(2) + chalk.gray.dim(spinner.frame()); if (!data.downloadSpeed) { logUpdate(pre + lineBreak(2)); return; } logUpdate(pre + speed()); }, 50);
const getSpinnerFromState = inputState => inputState === state ? chalk.gray.dim(spinner.frame()) : ' '
formatContainerState (state) { let stateFormatted = figures.square if (state === 'restarting') { return chalk.blue(stateFormatted) } if (state === 'running') { return chalk.green(stateFormatted) } if (state === 'paused') { return chalk.yellow(stateFormatted) } if (state === 'exited') { return chalk.gray(stateFormatted) } if (state === 'dead') { return chalk.red(stateFormatted) } return stateFormatted }
logStartMessages() { console.log( chalk.green.bold(`Listening on localhost:${this.app.get('port')}. Running in ${process.env.NODE_ENV}`), chalk.gray("\nCtrl-C to Shutdown")); function shutdown() { console.log(chalk.red("\nSite has shutdown")); process.exit(0); } // ensure that site exits correctly on Ctrl+C and SIGTERM process. removeAllListeners('SIGINT').on('SIGINT', shutdown). removeAllListeners('SIGTERM').on('SIGTERM', shutdown); }
output += `/${chalk.keyword('orange')('$')}` output += `\t${action.pattern.replace(/(?::[\w]+|\[:\w+\])/g, chalk.gray('$&'))}\n`
grid.map((row, gy) => { return row.map((col, gx) => { if (_.find(visited, {x: gx, y: gy})) return chalk.green('O') else return (col ? ' ' : chalk.gray('#')) }).join`` }).join('\n')
run() { const os = require('os'); const chalk = require('chalk'); const cliVersion = this.system.cliVersion; this.ui.log(`Ghost-CLI version: ${chalk.cyan(cliVersion)}`); const instance = this.system.getInstance(); // This will be false if we're not in a Ghost instance folder if (instance.version) { const dir = chalk.gray(`(at ${instance.dir.replace(os.homedir(), '~')})`); this.ui.log(`Ghost version: ${chalk.cyan(instance.version)} ${dir}`); } }
var flagsToString = function(flags) { var messageString = ''; _.each(_.keys(flags), function(key) { if (flags[key]) { messageString += _.startCase(key) + ' [x] '; } else { messageString += chalk.gray(_.startCase(key) + ' [ ] '); } }); return messageString; }
// cli info cli .version(pkg.version, '-v, --version') .usage(`${chalk.yellow('<command>')} ${chalk.gray('or')} snap ${chalk.yellow('<boilerplate-name> <project-directory> [options]')}`) .on('--help', () => { console.log('\nFor example, to save a React starter project from GitHub for future use...'); console.log(` snap save react https://github.com/user/react-starter.git`); console.log(` snap react my-project`); console.log(' cd my-project\n'); console.log('If you encounter any problems, please open an issue:'); console.log(` ${chalk.cyan('https://github.com/jolaleye/snap/issues')}\n`); });
lines.forEach(function (line) { output(chalk.gray(' < ' + line)); });
function printBanner(context, localPkg) { console.log(chalk.gray(`Node ${process.version}, ${pkg.name} ${VERSION}`)); console.log(chalk.bold.cyan(`${localPkg.name} ${localPkg.version}`)); console.log( 'Context:', Object.keys(context) .sort() .join(', ') ); }
grid.map((row, gy) => { return row.map((col, gx) => { if (gx === 1 && gy === 1) return chalk.yellow('O') else if (gx === goalX && gy === goalY) return chalk.yellow('O') else if (_.find(visited, {x: gx, y: gy})) return chalk.green('O') else return (col ? ' ' : chalk.gray('#')) }).join`` }).join('\n')
output += `/${chalk.keyword('orange')('$')}` output += `\t${action.pattern.replace(/(?::[\w]+|\[:\w+\])/g, chalk.gray('$&'))}\n`
lines.forEach((line) => { output(chalk.gray(` < ${ line }`)); });