const formatSource = async () => { console.log(chalk.reset('Formatting source files...')); try { const sourceFilePaths = await getSourceFilePaths(); const formattedPaths = await Promise.all(sourceFilePaths.map(filePath => formatFile(filePath, filePath))); console.log(chalk.green(`Formatted ${formattedPaths.length} files.`)); } catch (error) { console.log(chalk.red('Problem formatting file:\n'), chalk.reset(error)); process.exit(1); } }
_(app.info) .map(info => (info.healthy) ? chalk.green(info.service) : chalk.yellow(info.service)) .values() .join(', ')
const uploadColor = string => (data.isDone ? chalk.green(string) : chalk.cyan(string))
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 }
const token = async (options = {}) => { event('Generate Token'); const CubejsServer = await requireFromPackage('@cubejs-backend/server'); const { expiry = defaultExpiry, secret = CubejsServer.apiSecret() } = options; if (!secret) throw new Error('No app secret found').message; const extraOptions = {}; if (expiry !== '0') extraOptions.expiresIn = expiry; const payload = parsePayload(options.payload); console.log('Generating Cube.js JWT token'); console.log(''); console.log(`${chalk.yellow('-----------------------------------------------------------------------------------------')}`); console.log(` ${chalk.yellow('Use these manually generated tokens in production with caution.')}`); console.log(` ${chalk.yellow(`Please refer to ${chalk.cyan('https://cube.dev/docs/security')} for production security best practices.`)}`); console.log(`${chalk.yellow('-----------------------------------------------------------------------------------------')}`); console.log(''); console.log(`Expires in: ${chalk.green(expiry)}`); console.log(`Payload: ${chalk.green(JSON.stringify(payload))}`); console.log(''); const signedToken = jwt.sign(payload, secret, extraOptions); console.log(`Token: ${chalk.green(signedToken)}`); await event('Generate Token Success'); return signedToken; }
ok(msg) { this.log(green(msg)); }
const downloadColor = string => ((data.isDone || data.uploadSpeed) ? chalk.green(string) : chalk.cyan(string))
spinner.start(`3. Installing WordPress files from ${chalk.green('https://wordpress.org/')} ...`); await execa('npm', ['run', 'install:wordpress']); spinner.succeed();
str = chalk.cyan(chunk.toString('utf-8').trim()) } else { str = chalk.green(chunk.toString('utf-8').trim())
console.log(chalk.green(`Flood server starting on ${address}.\n`));
const check = async () => { console.log(chalk.reset('Validating source file formatting...')); try { const sourceFilePaths = await getSourceFilePaths(); await Promise.all( sourceFilePaths.map(async filePath => { const fileContent = await readFile(filePath); const prettierConfig = await prettier.resolveConfig(filePath); const isCompliant = prettier.check(fileContent, {...prettierConfig, filepath: filePath}); if (!isCompliant) { throw filePath; } }), ); console.log(chalk.green('Finished validating file formatting.')); } catch (error) { console.log(chalk.red('Unformatted file found:\n'), chalk.reset(error)); process.exit(1); } }
console.log(`To ignore, add ${chalk.cyan('// eslint-disable-next-line')} to the line before.\n`); } else { console.log(chalk.green('Compiled successfully.\n'));
const migrate = () => { log(chalk.green('Migrating data: moving rTorrent connection information to users database'));
const migrate = () => { log(chalk.green('Migrating data: resolving unset isAdmin flag'));
spinner.start(`3. Installing WordPress files from ${chalk.green('https://wordpress.org/')} ...`); await execa('npm', ['run', 'install:wordpress']); spinner.succeed();