console.log(chalk.yellow('Compiled with warnings.\n')); console.log(warnings.join('\n\n')); console.log(`\nSearch for the ${chalk.underline(chalk.yellow('keywords'))} to learn more about each warning.`); console.log(`To ignore, add ${chalk.cyan('// eslint-disable-next-line')} to the line before.\n`); } else {
server.on('listening', handleListening); const address = chalk.underline(`${useSSL ? 'https' : 'http'}://${host}:${port}`);
const logDetails = (bookmark) => { const excerpt = getExcerpt(bookmark) print({ prefix: " ", message: underline(gray(bookmark.hostname)) }) print({ prefix: " ", message: gray(excerpt) }) }
static buildMeta(functionName, message, id) { // {date+time} {id_underline} {functionName}: {message} let date = new Date(); let time = date.toISOString(); if (id == null) { id = ''; } else { time = time + ' '; }; return time + chalk.inverse(id) + ' ' + chalk.underline(functionName) + ': ' + message; }
const logDeprecatedCommand = (cmd, replacementCmd) => { console.log(''); console.log(chalk.red(`"${chalk.bold(`exptool ${cmd}`)}" is deprecated.`)); if (replacementCmd) { console.log(chalk.red(`Try using ${chalk.bold(replacementCmd)} instead.`)); } console.log(`See ${chalk.underline('https://github.com/mglagola/exptool/wiki/Deprecations')} for more info on deprecations.`); console.log(''); }
const printDetails = (label, items) => { var color = label === 'ERRORS' ? chalk.red : chalk.yellow console.error() console.error(chalk.bold(label)) items.forEach(item => { console.error(' ' + chalk.bold(chalk.underline.gray(pathToPtr(item.path))) + ': ' + color(item.message)) }) }
function nodeVersion(ctx) { if (process.env.GHOST_NODE_VERSION_CHECK !== 'false' && !semver.satisfies(process.versions.node, cliPackage.engines.node)) { return Promise.reject(new errors.SystemError({ message: `${chalk.red('The version of Node.js you are using is not supported.')} ${chalk.gray('Supported: ')}${cliPackage.engines.node} ${chalk.gray('Installed: ')}${process.versions.node} See ${chalk.underline.blue('https://ghost.org/faq/node-versions/')} for more information`, task: taskTitle })); } if (ctx.local || !ctx.system.platform.linux || (ctx.argv && ctx.argv['setup-linux-user'] === false)) { return Promise.resolve(); } return checkDirectoryAndAbove(process.argv[0], 'install node and Ghost-CLI', taskTitle); }
async function downloadArtifact (toDir, job = {}) { if (F.isNil(job.artifacts) || F.isNil(job.artifacts.url)) { throw new Error(`No artifact found for job - ${job.id}`); } const artifactExt = ARTIFACT_PLATFORM_EXTENSIONS[job.platform] || 'unknown'; const artifactFilepath = path.join(toDir, `app.${artifactExt}`); console.log(`Downloading artifact to ${chalk.underline(artifactFilepath)}`); return await downloadFile(job.artifacts.url, artifactFilepath); }
function printMode (modeName, files) { console.log(` ${green(underline(`Mode ${modeName.toUpperCase()}`))} \n`) files.forEach(file => { console.log(` ${getFileStatus(file)} - ${(file.generator + ':').padEnd(13, ' ')} ${file.relativeName} ${verifyMount(file)}`) }) console.log() }
toString() { let initial = chalk.red(`Error detected in the ${this.options.environment} configuration.\n\n`) + `${chalk.gray('Message:')} ${this.options.message}\n`; if (this.options.config) { const keys = Object.keys(this.options.config); const values = keys.map(key => this.options.config[key]); initial += `${chalk.gray('Configuration Key(s):')} ${keys.join(' / ')}\n` + `${chalk.gray('Current Value(s):')} ${values.join(' / ')}\n\n`; this.options.help = this.options.help || chalk.blue(`Run \`${chalk.underline('ghost config <key> <new value>')}\` for each key to fix the issue.\n`); } if (this.options.help) { initial += `${chalk.gray('Help:')} ${this.options.help}\n`; } return initial; }
function logSuccess(name) { console.log(chalk.green('\nSuccess! \(^O^)/')); console.log(`You can now run ${chalk.yellow('snap', chalk.underline(name), '<project-directory>')} to use your new boilerplate!\n`); }
log(chalk.green('Success! ') + number + ' sample receipt(s) has been created in ' + chalk.underline(destDir))
async function checkIfBuilt (projectManifest, expState, { timeout = ARTIFACT_BUILT_TIMEOUT, interval = ARTIFACT_SLEEP_TIMEOUT } = {}) { let startTime = new Date().getTime(); const endTime = startTime + secondsToMilliseconds(timeout); // 15 mins while (startTime <= endTime) { const job = F.head(await fetchArtifactJobs(projectManifest, expState)); const jobStatus = job.status; switch (jobStatus) { case 'finished': console.log(chalk.green('Artifact built:'), chalk.underline(job.artifacts.url)); return true; case 'in-progress': console.log(`Artifact still building, checking again in ${interval}s ...`); break; default: console.log(chalk.red(`Unknown status: ${jobStatus} - aborting!`)); return false; } startTime = new Date().getTime(); await sleep(secondsToMilliseconds(interval)); } console.log(chalk.red(`Timeout reached! Project is taking longer than expected to finish building, aborting...`)); return false; }
output += chalk.underline(result.filePath) + '\n'
For more information, see ${chalk.underline.green('https://ghost.org/docs/install/ubuntu/#create-a-new-user-')}.\n`); } else { There's a guide to fixing your setup here: ${chalk.underline.green('https://ghost.org/faq/root-user-fix/')}.\n`); console.error(`${chalk.yellow('It looks like Ghost was installed using the root user.')} You need to create a user with regular account privileges and migrate your installation to this user. There's a guide to fixing your setup here: ${chalk.underline.green('https://ghost.org/faq/root-user-fix/')}.\n`); console.error(`${chalk.yellow('You can\'t run commands as the \'root\' user.')} Switch to your regular user, or create a new user with regular account privileges and use this user to run 'ghost ${command}'. For more information, see ${chalk.underline.green('https://ghost.org/docs/install/ubuntu/#create-a-new-user-')}.\n`);