diff --git a/bin/domains/buy.js b/bin/domains/buy.js index 69009d4..799fc6d 100644 --- a/bin/domains/buy.js +++ b/bin/domains/buy.js @@ -30,15 +30,11 @@ module.exports = async function({ domains, args, currentTeam, user }) { stopSpinner() if (!available) { - return error( - `The domain ${nameParam} is ${italic('unavailable')}! ${elapsed()}` - ) + return error(`The domain ${nameParam} is ${italic('unavailable')}! ${elapsed()}`) } info(`The domain ${nameParam} is ${italic('available')}! ${elapsed()}`) - const confirmation = await promptBool( - `Buy now for ${bold(`$${price}`)} (${bold((currentTeam && currentTeam.slug) || user.username || user.email)})?` - ) + const confirmation = await promptBool(`Buy now for ${bold(`$${price}`)} (${bold((currentTeam && currentTeam.slug) || user.username || user.email)})?`) eraseLines(1) if (!confirmation) { @@ -58,7 +54,5 @@ module.exports = async function({ domains, args, currentTeam, user }) { stopSpinner() success(`Domain purchased and created ${uid(domain.uid)} ${elapsed()}`) - info( - `You may now use your domain as an alias to your deployments. Run ${cmd('now alias help')}` - ) + info(`You may now use your domain as an alias to your deployments. Run ${cmd('now alias help')}`) } diff --git a/bin/now-alias.js b/bin/now-alias.js index d9776d5..a373b6e 100755 --- a/bin/now-alias.js +++ b/bin/now-alias.js @@ -110,7 +110,7 @@ if (argv.help) { exit(0) } else { Promise.resolve().then(async () => { - const config = await cfg.read({token: argv.token}) + const config = await cfg.read({ token: argv.token }) let token try { diff --git a/bin/now-billing-add.js b/bin/now-billing-add.js index 554559e..65c4d42 100644 --- a/bin/now-billing-add.js +++ b/bin/now-billing-add.js @@ -137,13 +137,11 @@ module.exports = function({ creditCards, currentTeam, user }) { } brand = chalk.cyan(`[${brand}]`) const masked = chalk.gray('#### '.repeat(3)) + result.split(' ')[3] - process.stdout.write( - `${chalk.cyan(tick)} ${piece.label}${masked} ${brand}\n` - ) + process.stdout + .write(`${chalk.cyan(tick)} ${piece.label}${masked} ${brand}\n`) } else if (key === 'ccv') { - process.stdout.write( - `${chalk.cyan(tick)} ${piece.label}${'*'.repeat(result.length)}\n` - ) + process.stdout + .write(`${chalk.cyan(tick)} ${piece.label}${'*'.repeat(result.length)}\n`) } else if (key === 'expDate') { let text = result.split(' / ') text = text[0] + chalk.gray(' / ') + text[1] @@ -161,13 +159,11 @@ module.exports = function({ creditCards, currentTeam, user }) { state.city.initialValue = addressInfo.city } stopSpinner() - process.stdout.write( - `${chalk.cyan(tick)} ${piece.label}${result}\n` - ) + process.stdout + .write(`${chalk.cyan(tick)} ${piece.label}${result}\n`) } else { - process.stdout.write( - `${chalk.cyan(tick)} ${piece.label}${result}\n` - ) + process.stdout + .write(`${chalk.cyan(tick)} ${piece.label}${result}\n`) } } catch (err) { if (err.message === 'USER_ABORT') { @@ -194,9 +190,7 @@ module.exports = function({ creditCards, currentTeam, user }) { address1: state.address1.value }) stopSpinner() - success( - `${state.cardNumber.brand} ending in ${res.last4} was added to ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}` - ) + success(`${state.cardNumber.brand} ending in ${res.last4} was added to ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}`) } catch (err) { stopSpinner() const linesToClear = state.error ? 13 : 12 diff --git a/bin/now-billing.js b/bin/now-billing.js index f09e36f..942d9dc 100644 --- a/bin/now-billing.js +++ b/bin/now-billing.js @@ -33,8 +33,7 @@ const argv = minimist(process.argv.slice(2), { const subcommand = argv._[0] const help = () => { - console.log( - ` + console.log(` ${chalk.bold(`${logo} now billing`)} ${chalk.dim('Options:')} @@ -65,8 +64,7 @@ const help = () => { ${chalk.cyan(`$ now billing set-default `)} ${chalk.gray('–')} If the id is omitted, you can choose interactively - ` - ) + `) } // Options @@ -90,7 +88,7 @@ if (argv.help || !subcommand) { exit(0) } else { Promise.resolve().then(async () => { - const config = await cfg.read({token: argv.token}) + const config = await cfg.read({ token: argv.token }) let token try { @@ -184,9 +182,7 @@ async function run({ token, config: { currentTeam, user } }) { .join('\n\n') const elapsed = ms(new Date() - start) - console.log( - `> ${cards.cards.length} card${cards.cards.length === 1 ? '' : 's'} found under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)} ${chalk.gray(`[${elapsed}]`)}` - ) + console.log(`> ${cards.cards.length} card${cards.cards.length === 1 ? '' : 's'} found under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)} ${chalk.gray(`[${elapsed}]`)}`) if (text) { console.log(`\n${text}\n`) } @@ -246,9 +242,7 @@ async function run({ token, config: { currentTeam, user } }) { const card = cards.cards.find(card => card.id === cardId) const elapsed = ms(new Date() - start) - success( - `${card.brand} ending in ${card.last4} is now the default ${chalk.gray(`[${elapsed}]`)}` - ) + success(`${card.brand} ending in ${card.last4} is now the default ${chalk.gray(`[${elapsed}]`)}`) } else { console.log('No changes made') } @@ -273,9 +267,7 @@ async function run({ token, config: { currentTeam, user } }) { } if (cards.cards.length === 0) { - error( - `You have no credit cards to choose from to delete under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}` - ) + error(`You have no credit cards to choose from to delete under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}`) return exit(0) } diff --git a/bin/now-certs.js b/bin/now-certs.js index 8c9272b..4c04992 100755 --- a/bin/now-certs.js +++ b/bin/now-certs.js @@ -31,8 +31,7 @@ const subcommand = argv._[0] // Options const help = () => { - console.log( - ` + console.log(` ${chalk.bold(`${logo} now certs`)} ${chalk.dim('Note:')} @@ -66,8 +65,7 @@ const help = () => { ${chalk.gray('–')} Replacing an existing certificate with a user-supplied certificate: ${chalk.cyan('$ now certs replace --crt domain.crt --key domain.key --ca ca_chain.crt domain.com')} -` - ) +`) } // Options @@ -83,7 +81,7 @@ if (argv.help || !subcommand) { exit(0) } else { Promise.resolve().then(async () => { - const config = await cfg.read({token: argv.token}) + const config = await cfg.read({ token: argv.token }) let token try { @@ -116,18 +114,14 @@ async function run({ token, config: { currentTeam, user } }) { if (subcommand === 'ls' || subcommand === 'list') { if (args.length !== 0) { - error( - `Invalid number of arguments. Usage: ${chalk.cyan('`now certs ls`')}` - ) + error(`Invalid number of arguments. Usage: ${chalk.cyan('`now certs ls`')}`) return exit(1) } const list = await certs.ls() const elapsed = ms(new Date() - start) - console.log( - `> ${list.length} certificate${list.length === 1 ? '' : 's'} found ${chalk.gray(`[${elapsed}]`)} under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}` - ) + console.log(`> ${list.length} certificate${list.length === 1 ? '' : 's'} found ${chalk.gray(`[${elapsed}]`)} under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}`) if (list.length > 0) { const cur = Date.now() @@ -168,9 +162,7 @@ async function run({ token, config: { currentTeam, user } }) { } } else if (subcommand === 'create') { if (args.length !== 1) { - error( - `Invalid number of arguments. Usage: ${chalk.cyan('`now certs create `')}` - ) + error(`Invalid number of arguments. Usage: ${chalk.cyan('`now certs create `')}`) return exit(1) } const cn = args[0] @@ -179,9 +171,7 @@ async function run({ token, config: { currentTeam, user } }) { if (argv.crt || argv.key || argv.ca) { // Issue a custom certificate if (!argv.crt || !argv.key) { - error( - `Missing required arguments for a custom certificate entry. Usage: ${chalk.cyan('`now certs create --crt DOMAIN.CRT --key DOMAIN.KEY [--ca CA.CRT] `')}` - ) + error(`Missing required arguments for a custom certificate entry. Usage: ${chalk.cyan('`now certs create --crt DOMAIN.CRT --key DOMAIN.KEY [--ca CA.CRT] `')}`) return exit(1) } @@ -199,14 +189,10 @@ async function run({ token, config: { currentTeam, user } }) { return exit(1) } const elapsed = ms(new Date() - start) - console.log( - `${chalk.cyan('> Success!')} Certificate entry ${chalk.bold(cn)} ${chalk.gray(`(${cert.uid})`)} created ${chalk.gray(`[${elapsed}]`)}` - ) + console.log(`${chalk.cyan('> Success!')} Certificate entry ${chalk.bold(cn)} ${chalk.gray(`(${cert.uid})`)} created ${chalk.gray(`[${elapsed}]`)}`) } else if (subcommand === 'renew') { if (args.length !== 1) { - error( - `Invalid number of arguments. Usage: ${chalk.cyan('`now certs renew `')}` - ) + error(`Invalid number of arguments. Usage: ${chalk.cyan('`now certs renew `')}`) return exit(1) } @@ -226,14 +212,10 @@ async function run({ token, config: { currentTeam, user } }) { await certs.renew(cert.cn) const elapsed = ms(new Date() - start) - console.log( - `${chalk.cyan('> Success!')} Certificate ${chalk.bold(cert.cn)} ${chalk.gray(`(${cert.uid})`)} renewed ${chalk.gray(`[${elapsed}]`)}` - ) + console.log(`${chalk.cyan('> Success!')} Certificate ${chalk.bold(cert.cn)} ${chalk.gray(`(${cert.uid})`)} renewed ${chalk.gray(`[${elapsed}]`)}`) } else if (subcommand === 'replace') { if (!argv.crt || !argv.key) { - error( - `Invalid number of arguments. Usage: ${chalk.cyan('`now certs replace --crt DOMAIN.CRT --key DOMAIN.KEY [--ca CA.CRT] `')}` - ) + error(`Invalid number of arguments. Usage: ${chalk.cyan('`now certs replace --crt DOMAIN.CRT --key DOMAIN.KEY [--ca CA.CRT] `')}`) return exit(1) } @@ -256,14 +238,10 @@ async function run({ token, config: { currentTeam, user } }) { await certs.put(cert.cn, crt, key, ca) const elapsed = ms(new Date() - start) - console.log( - `${chalk.cyan('> Success!')} Certificate ${chalk.bold(cert.cn)} ${chalk.gray(`(${cert.uid})`)} replaced ${chalk.gray(`[${elapsed}]`)}` - ) + console.log(`${chalk.cyan('> Success!')} Certificate ${chalk.bold(cert.cn)} ${chalk.gray(`(${cert.uid})`)} replaced ${chalk.gray(`[${elapsed}]`)}`) } else if (subcommand === 'rm' || subcommand === 'remove') { if (args.length !== 1) { - error( - `Invalid number of arguments. Usage: ${chalk.cyan('`now certs rm `')}` - ) + error(`Invalid number of arguments. Usage: ${chalk.cyan('`now certs rm `')}`) return exit(1) } @@ -282,9 +260,7 @@ async function run({ token, config: { currentTeam, user } }) { await certs.delete(cert.cn) const elapsed = ms(new Date() - start) - console.log( - `${chalk.cyan('> Success!')} Certificate ${chalk.bold(cert.cn)} ${chalk.gray(`(${cert.uid})`)} removed ${chalk.gray(`[${elapsed}]`)}` - ) + console.log(`${chalk.cyan('> Success!')} Certificate ${chalk.bold(cert.cn)} ${chalk.gray(`(${cert.uid})`)} removed ${chalk.gray(`[${elapsed}]`)}`) } else { error( 'Please specify a valid subcommand: ls | create | renew | replace | rm' @@ -311,9 +287,8 @@ function readConfirmation(cert, msg) { process.stdout.write(`> ${msg}`) process.stdout.write(' ' + tbl + '\n') - process.stdout.write( - `${chalk.bold.red('> Are you sure?')} ${chalk.gray('[y/N] ')}` - ) + process.stdout + .write(`${chalk.bold.red('> Are you sure?')} ${chalk.gray('[y/N] ')}`) process.stdin .on('data', d => { @@ -335,9 +310,7 @@ async function getCertIdCn(certs, idOrCn, currentTeam, user) { })[0] if (!thecert) { - error( - `No certificate found by id or cn "${idOrCn}" under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}` - ) + error(`No certificate found by id or cn "${idOrCn}" under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}`) return null } diff --git a/bin/now-deploy.js b/bin/now-deploy.js index 9746df7..281b232 100755 --- a/bin/now-deploy.js +++ b/bin/now-deploy.js @@ -202,7 +202,7 @@ if (deploymentName || wantsPublic) { let alwaysForwardNpm Promise.resolve().then(async () => { - let config = await cfg.read({token: argv.token}) + let config = await cfg.read({ token: argv.token }) alwaysForwardNpm = config.forwardNpm if (argv.h || argv.help) { diff --git a/bin/now-dns.js b/bin/now-dns.js index 3b1e92f..1167aa3 100755 --- a/bin/now-dns.js +++ b/bin/now-dns.js @@ -31,8 +31,7 @@ const subcommand = argv._[0] // Options const help = () => { - console.log( - ` + console.log(` ${chalk.bold(`${logo} now dns ls`)} [domain] ${chalk.bold(`${logo} now dns add`)} ${chalk.bold(`${logo} now dns add`)} MX @@ -61,8 +60,7 @@ const help = () => { ${chalk.cyan('$ now dns add @ MX ')} ${chalk.cyan('$ now dns add zeit.rocks @ MX mail.zeit.rocks 10')} -` - ) +`) } // Options @@ -77,7 +75,7 @@ if (argv.help || !subcommand) { exit(0) } else { Promise.resolve().then(async () => { - const config = await cfg.read({token: argv.token}) + const config = await cfg.read({ token: argv.token }) let token try { @@ -103,9 +101,7 @@ async function run({ token, config: { currentTeam, user } }) { if (subcommand === 'ls' || subcommand === 'list') { if (args.length > 1) { - error( - `Invalid number of arguments. Usage: ${chalk.cyan('`now dns ls [domain]`')}` - ) + error(`Invalid number of arguments. Usage: ${chalk.cyan('`now dns ls [domain]`')}`) return exit(1) } @@ -148,28 +144,20 @@ async function run({ token, config: { currentTeam, user } }) { text.push(`\n\n${chalk.bold(domain)}\n${indent(out, 2)}`) } }) - console.log( - `> ${count} record${count === 1 ? '' : 's'} found ${chalk.gray(`[${elapsed}]`)} under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}` - ) + console.log(`> ${count} record${count === 1 ? '' : 's'} found ${chalk.gray(`[${elapsed}]`)} under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}`) console.log(text.join('')) } else if (subcommand === 'add') { const param = parseAddArgs(args) if (!param) { - error( - `Invalid number of arguments. See: ${chalk.cyan('`now dns --help`')} for usage.` - ) + error(`Invalid number of arguments. See: ${chalk.cyan('`now dns --help`')} for usage.`) return exit(1) } const record = await domainRecords.create(param.domain, param.data) const elapsed = ms(new Date() - start) - console.log( - `${chalk.cyan('> Success!')} A new DNS record for domain ${chalk.bold(param.domain)} ${chalk.gray(`(${record.uid})`)} created ${chalk.gray(`[${elapsed}]`)} (${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)})` - ) + console.log(`${chalk.cyan('> Success!')} A new DNS record for domain ${chalk.bold(param.domain)} ${chalk.gray(`(${record.uid})`)} created ${chalk.gray(`[${elapsed}]`)} (${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)})`) } else if (subcommand === 'rm' || subcommand === 'remove') { if (args.length !== 1) { - error( - `Invalid number of arguments. Usage: ${chalk.cyan('`now dns rm `')}` - ) + error(`Invalid number of arguments. Usage: ${chalk.cyan('`now dns rm `')}`) return exit(1) } @@ -190,9 +178,7 @@ async function run({ token, config: { currentTeam, user } }) { await domainRecords.delete(record.domain, record.id) const elapsed = ms(new Date() - start) - console.log( - `${chalk.cyan('> Success!')} Record ${chalk.gray(`${record.id}`)} removed ${chalk.gray(`[${elapsed}]`)}` - ) + console.log(`${chalk.cyan('> Success!')} Record ${chalk.gray(`${record.id}`)} removed ${chalk.gray(`[${elapsed}]`)}`) } else { error('Please specify a valid subcommand: ls | add | rm') help() @@ -277,9 +263,7 @@ function readConfirmation(record, msg) { [ [ record.id, - chalk.bold( - `${record.name.length > 0 ? record.name + '.' : ''}${record.domain} ${record.type} ${record.value} ${record.mxPriority ? record.mxPriority : ''}` - ), + chalk.bold(`${record.name.length > 0 ? record.name + '.' : ''}${record.domain} ${record.type} ${record.value} ${record.mxPriority ? record.mxPriority : ''}`), time ] ], @@ -289,9 +273,8 @@ function readConfirmation(record, msg) { process.stdout.write(`> ${msg}`) process.stdout.write(' ' + tbl + '\n') - process.stdout.write( - `${chalk.bold.red('> Are you sure?')} ${chalk.gray('[y/N] ')}` - ) + process.stdout + .write(`${chalk.bold.red('> Are you sure?')} ${chalk.gray('[y/N] ')}`) process.stdin .on('data', d => { diff --git a/bin/now-domains.js b/bin/now-domains.js index f67fc83..e73b6fa 100755 --- a/bin/now-domains.js +++ b/bin/now-domains.js @@ -36,8 +36,7 @@ const subcommand = argv._[0] // Options const help = () => { - console.log( - ` + console.log(` ${chalk.bold(`${logo} now domains`)} ${chalk.dim('Options:')} @@ -102,8 +101,7 @@ const help = () => { ${chalk.cyan('$ now domain add -e my-app.com')} and follow the verification instructions if requested. Finally, rerun the same command after completing the verification step. -` - ) +`) } // Options @@ -119,7 +117,7 @@ if (argv.help || !subcommand) { exit(0) } else { Promise.resolve().then(async () => { - const config = await cfg.read({token: argv.token}) + const config = await cfg.read({ token: argv.token }) let token try { @@ -183,9 +181,7 @@ async function run({ token, config: { currentTeam, user } }) { ) const elapsed_ = ms(new Date() - start_) - console.log( - `> ${domains.length} domain${domains.length === 1 ? '' : 's'} found under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)} ${chalk.gray(`[${elapsed_}]`)}` - ) + console.log(`> ${domains.length} domain${domains.length === 1 ? '' : 's'} found under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)} ${chalk.gray(`[${elapsed_}]`)}`) if (out) { console.log('\n' + out + '\n') @@ -232,9 +228,7 @@ async function run({ token, config: { currentTeam, user } }) { const start = new Date() await domain.rm(_domain.name) const elapsed = ms(new Date() - start) - console.log( - `${chalk.cyan('> Success!')} Domain ${chalk.bold(_domain.uid)} removed [${elapsed}]` - ) + console.log(`${chalk.cyan('> Success!')} Domain ${chalk.bold(_domain.uid)} removed [${elapsed}]`) } catch (err) { error(err) exit(1) @@ -257,17 +251,11 @@ async function run({ token, config: { currentTeam, user } }) { ) const elapsed = ms(new Date() - start) if (created) { - console.log( - `${chalk.cyan('> Success!')} Domain ${chalk.bold(chalk.underline(name))} ${chalk.dim(`(${uid})`)} added [${elapsed}]` - ) + console.log(`${chalk.cyan('> Success!')} Domain ${chalk.bold(chalk.underline(name))} ${chalk.dim(`(${uid})`)} added [${elapsed}]`) } else if (verified) { - console.log( - `${chalk.cyan('> Success!')} Domain ${chalk.bold(chalk.underline(name))} ${chalk.dim(`(${uid})`)} verified [${elapsed}]` - ) + console.log(`${chalk.cyan('> Success!')} Domain ${chalk.bold(chalk.underline(name))} ${chalk.dim(`(${uid})`)} verified [${elapsed}]`) } else if (code === 'not_modified') { - console.log( - `${chalk.cyan('> Success!')} Domain ${chalk.bold(chalk.underline(name))} ${chalk.dim(`(${uid})`)} already exists [${elapsed}]` - ) + console.log(`${chalk.cyan('> Success!')} Domain ${chalk.bold(chalk.underline(name))} ${chalk.dim(`(${uid})`)} already exists [${elapsed}]`) } else { console.log( '> Verification required: Please rerun this command after some time' @@ -312,9 +300,8 @@ async function readConfirmation(domain, _domain) { ) } - process.stdout.write( - ` ${chalk.bold.red('> Are you sure?')} ${chalk.gray('[y/N] ')}` - ) + process.stdout + .write(` ${chalk.bold.red('> Are you sure?')} ${chalk.gray('[y/N] ')}`) process.stdin .on('data', d => { diff --git a/bin/now-list.js b/bin/now-list.js index ca60ab1..b0a9ded 100755 --- a/bin/now-list.js +++ b/bin/now-list.js @@ -68,7 +68,7 @@ if (argv.config) { } Promise.resolve().then(async () => { - const config = await cfg.read({token: argv.token}) + const config = await cfg.read({ token: argv.token }) let token try { diff --git a/bin/now-logout.js b/bin/now-logout.js index 80221f5..bc233ff 100644 --- a/bin/now-logout.js +++ b/bin/now-logout.js @@ -20,8 +20,7 @@ const argv = minimist(process.argv.slice(2), { }) const help = () => { - console.log( - ` + console.log(` ${chalk.bold(`${logo} now logout`)} ${chalk.dim('Options:')} @@ -34,8 +33,7 @@ const help = () => { ${chalk.gray('–')} Logout from the CLI: ${chalk.cyan('$ now logout')} -` - ) +`) } if (argv.help) { diff --git a/bin/now-logs.js b/bin/now-logs.js index f8ebaa6..8f1a2d0 100644 --- a/bin/now-logs.js +++ b/bin/now-logs.js @@ -29,8 +29,7 @@ const argv = minimist(process.argv.slice(2), { let deploymentIdOrURL = argv._[0] const help = () => { - console.log( - ` + console.log(` ${chalk.bold(`${logo} now logs`)} ${chalk.dim('Options:')} @@ -51,8 +50,7 @@ const help = () => { ${chalk.gray('–')} Print logs for the deployment ${chalk.dim('`deploymentId`')} ${chalk.cyan('$ now logs deploymentId')} -` - ) +`) } if (argv.help || !deploymentIdOrURL) { @@ -98,7 +96,7 @@ if (maybeURL(deploymentIdOrURL)) { Promise.resolve() .then(async () => { - const config = await cfg.read({token: argv.token}) + const config = await cfg.read({ token: argv.token }) let token try { diff --git a/bin/now-open.js b/bin/now-open.js index 6eabb63..18ca860 100644 --- a/bin/now-open.js +++ b/bin/now-open.js @@ -25,8 +25,7 @@ const argv = minimist(process.argv.slice(2), { }) const help = () => { - console.log( - ` + console.log(` ${chalk.bold(`${logo} now open`)} ${chalk.dim('Options:')} @@ -42,8 +41,7 @@ const help = () => { ${chalk.cyan('$ now open')} -` - ) +`) } if (argv.help) { @@ -62,7 +60,7 @@ if (argv.config) { } Promise.resolve().then(async () => { - const config = await cfg.read({token: argv.token}) + const config = await cfg.read({ token: argv.token }) let token try { @@ -114,9 +112,7 @@ async function open({ token, config: { currentTeam, user } }) { ) if (typeof currentProjectDeployments === 'undefined') { - console.log( - `No deployments found for ${chalk.bold(pkg.name)} under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}` - ) + console.log(`No deployments found for ${chalk.bold(pkg.name)} under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}`) process.exit(0) } @@ -126,9 +122,7 @@ async function open({ token, config: { currentTeam, user } }) { try { const url = `https://${latestDeploy.url}` - console.log( - `Opening the latest deployment for ${chalk.bold(pkg.name)}... under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}` - ) + console.log(`Opening the latest deployment for ${chalk.bold(pkg.name)}... under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}`) console.log(`Here's the URL: ${chalk.underline(url)}`) opn(url) diff --git a/bin/now-remove.js b/bin/now-remove.js index e4c46c1..2976d21 100755 --- a/bin/now-remove.js +++ b/bin/now-remove.js @@ -30,8 +30,7 @@ const ids = argv._ // Options const help = () => { - console.log( - ` + console.log(` ${chalk.bold(`${logo} now remove`)} deploymentId|deploymentName [...deploymentId|deploymentName] ${chalk.dim('Options:')} @@ -57,8 +56,7 @@ const help = () => { ${chalk.cyan('$ now rm eyWt6zuSdeus uWHoA9RQ1d1o')} ${chalk.dim('Alias:')} rm -` - ) +`) } if (argv.help || ids.length === 0) { @@ -77,7 +75,7 @@ if (argv.config) { } Promise.resolve().then(async () => { - const config = await cfg.read({token: argv.token}) + const config = await cfg.read({ token: argv.token }) let token try { @@ -97,9 +95,8 @@ Promise.resolve().then(async () => { function readConfirmation(matches) { return new Promise(resolve => { - process.stdout.write( - `> The following deployment${matches.length === 1 ? '' : 's'} will be removed permanently:\n` - ) + process.stdout + .write(`> The following deployment${matches.length === 1 ? '' : 's'} will be removed permanently:\n`) const tbl = table( matches.map(depl => { @@ -120,9 +117,8 @@ function readConfirmation(matches) { } } - process.stdout.write( - `${chalk.bold.red('> Are you sure?')} ${chalk.gray('[y/N] ')}` - ) + process.stdout + .write(`${chalk.bold.red('> Are you sure?')} ${chalk.gray('[y/N] ')}`) process.stdin .on('data', d => { @@ -145,11 +141,9 @@ async function remove({ token, config: { currentTeam } }) { }) if (matches.length === 0) { - error( - `Could not find any deployments matching ${ids - .map(id => chalk.bold(`"${id}"`)) - .join(', ')}. Run ${chalk.dim(`\`now ls\``)} to list.` - ) + error(`Could not find any deployments matching ${ids + .map(id => chalk.bold(`"${id}"`)) + .join(', ')}. Run ${chalk.dim(`\`now ls\``)} to list.`) return process.exit(1) } diff --git a/bin/now-scale.js b/bin/now-scale.js index 288806d..d875a4a 100755 --- a/bin/now-scale.js +++ b/bin/now-scale.js @@ -17,7 +17,7 @@ const login = require('../lib/login') const exit = require('../lib/utils/exit') const logo = require('../lib/utils/output/logo') const info = require('../lib/scale-info') -const sort = require('../lib/sort-deployments'); +const sort = require('../lib/sort-deployments') const argv = minimist(process.argv.slice(2), { string: ['config', 'token'], @@ -31,8 +31,7 @@ const optionalScaleArg = argv._[2] // Options const help = () => { - console.log( - ` + console.log(` ${chalk.bold(`${logo} now scale`)} ls ${chalk.bold(`${logo} now scale`)} ${chalk.bold(`${logo} now scale`)} [max] @@ -64,8 +63,7 @@ const help = () => { ${chalk.gray('–')} Create an deployment that is always active and never "sleeps": ${chalk.cyan('$ now scale my-deployment-ntahoeato.now.sh 1')} - ` - ) + `) } // Options @@ -81,7 +79,7 @@ if (argv.help) { exit(0) } else { Promise.resolve().then(async () => { - const config = await cfg.read({token: argv.token}) + const config = await cfg.read({ token: argv.token }) let token try { @@ -197,9 +195,7 @@ async function run({ token, config: { currentTeam } }) { } if ((match.state === 'FROZEN' || match.scale.current === 0) && min > 0) { - console.log( - `> Deployment is currently in 0 replicas, preparing deployment for scaling...` - ) + console.log(`> Deployment is currently in 0 replicas, preparing deployment for scaling...`) if (match.scale.max < 1) { await scale.setScale(match.uid, { min: 0, max: 1 }) } @@ -217,9 +213,7 @@ async function run({ token, config: { currentTeam } }) { const log = console.log log(`> ${chalk.cyan('Success!')} Configured scaling rules [${elapsed}]`) log() - log( - `${chalk.bold(match.url)} (${chalk.gray(currentReplicas)} ${chalk.gray('current')})` - ) + log(`${chalk.bold(match.url)} (${chalk.gray(currentReplicas)} ${chalk.gray('current')})`) log(printf('%6s %s', 'min', chalk.bold(newMin))) log(printf('%6s %s', 'max', chalk.bold(newMax))) log(printf('%6s %s', 'auto', chalk.bold(newMin === newMax ? '✖' : '✔'))) @@ -248,19 +242,17 @@ async function list(scale) { apps.set(dep.name, deps.concat(dep)) } - const sorted = await sort([...apps]); + const sorted = await sort([...apps]) - const timeNow = new Date(); + const timeNow = new Date() const urlLength = deployments.reduce((acc, i) => { return Math.max(acc, (i.url && i.url.length) || 0) }, 0) + 5 for (const app of sorted) { - const depls = argv.all ? app[1] : app[1].slice(0, 5); - console.log( - `${chalk.bold(app[0])} ${chalk.gray('(' + depls.length + ' of ' + app[1].length + ' total)')}` - ) + const depls = argv.all ? app[1] : app[1].slice(0, 5) + console.log(`${chalk.bold(app[0])} ${chalk.gray('(' + depls.length + ' of ' + app[1].length + ' total)')}`) console.log() const urlSpec = `%-${urlLength}s` console.log( diff --git a/bin/now-secrets.js b/bin/now-secrets.js index ee6b765..140dd11 100755 --- a/bin/now-secrets.js +++ b/bin/now-secrets.js @@ -31,8 +31,7 @@ const subcommand = argv._[0] // Options const help = () => { - console.log( - ` + console.log(` ${chalk.bold(`${logo} now secrets`)} ${chalk.dim('Options:')} @@ -70,8 +69,7 @@ const help = () => { ${chalk.gray('–')} Removes a secret: ${chalk.cyan(`$ now secrets rm my-secret`)} -` - ) +`) } // Options @@ -87,7 +85,7 @@ if (argv.help || !subcommand) { exit(0) } else { Promise.resolve().then(async () => { - const config = await cfg.read({token: argv.token}) + const config = await cfg.read({ token: argv.token }) let token try { @@ -113,18 +111,14 @@ async function run({ token, config: { currentTeam, user } }) { if (subcommand === 'ls' || subcommand === 'list') { if (args.length !== 0) { - error( - `Invalid number of arguments. Usage: ${chalk.cyan('`now secret ls`')}` - ) + error(`Invalid number of arguments. Usage: ${chalk.cyan('`now secret ls`')}`) return exit(1) } const list = await secrets.ls() const elapsed = ms(new Date() - start) - console.log( - `> ${list.length} secret${list.length === 1 ? '' : 's'} found under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)} ${chalk.gray(`[${elapsed}]`)}` - ) + console.log(`> ${list.length} secret${list.length === 1 ? '' : 's'} found under ${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)} ${chalk.gray(`[${elapsed}]`)}`) if (list.length > 0) { const cur = Date.now() @@ -156,9 +150,7 @@ async function run({ token, config: { currentTeam, user } }) { if (subcommand === 'rm' || subcommand === 'remove') { if (args.length !== 1) { - error( - `Invalid number of arguments. Usage: ${chalk.cyan('`now secret rm `')}` - ) + error(`Invalid number of arguments. Usage: ${chalk.cyan('`now secret rm `')}`) return exit(1) } const list = await secrets.ls() @@ -179,38 +171,28 @@ async function run({ token, config: { currentTeam, user } }) { const secret = await secrets.rm(args[0]) const elapsed = ms(new Date() - start) - console.log( - `${chalk.cyan('> Success!')} Secret ${chalk.bold(secret.name)} ${chalk.gray(`(${secret.uid})`)} removed ${chalk.gray(`[${elapsed}]`)}` - ) + console.log(`${chalk.cyan('> Success!')} Secret ${chalk.bold(secret.name)} ${chalk.gray(`(${secret.uid})`)} removed ${chalk.gray(`[${elapsed}]`)}`) return secrets.close() } if (subcommand === 'rename') { if (args.length !== 2) { - error( - `Invalid number of arguments. Usage: ${chalk.cyan('`now secret rename `')}` - ) + error(`Invalid number of arguments. Usage: ${chalk.cyan('`now secret rename `')}`) return exit(1) } const secret = await secrets.rename(args[0], args[1]) const elapsed = ms(new Date() - start) - console.log( - `${chalk.cyan('> Success!')} Secret ${chalk.bold(secret.oldName)} ${chalk.gray(`(${secret.uid})`)} renamed to ${chalk.bold(args[1])} ${chalk.gray(`[${elapsed}]`)}` - ) + console.log(`${chalk.cyan('> Success!')} Secret ${chalk.bold(secret.oldName)} ${chalk.gray(`(${secret.uid})`)} renamed to ${chalk.bold(args[1])} ${chalk.gray(`[${elapsed}]`)}`) return secrets.close() } if (subcommand === 'add' || subcommand === 'set') { if (args.length !== 2) { - error( - `Invalid number of arguments. Usage: ${chalk.cyan('`now secret add `')}` - ) + error(`Invalid number of arguments. Usage: ${chalk.cyan('`now secret add `')}`) if (args.length > 2) { const example = chalk.cyan(`$ now secret add ${args[0]}`) - console.log( - `> If your secret has spaces, make sure to wrap it in quotes. Example: \n ${example} ` - ) + console.log(`> If your secret has spaces, make sure to wrap it in quotes. Example: \n ${example} `) } return exit(1) @@ -228,9 +210,7 @@ async function run({ token, config: { currentTeam, user } }) { const secret = await secrets.add(name, value) const elapsed = ms(new Date() - start) - console.log( - `${chalk.cyan('> Success!')} Secret ${chalk.bold(name.toLowerCase())} ${chalk.gray(`(${secret.uid})`)} added (${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}) ${chalk.gray(`[${elapsed}]`)}` - ) + console.log(`${chalk.cyan('> Success!')} Secret ${chalk.bold(name.toLowerCase())} ${chalk.gray(`(${secret.uid})`)} added (${chalk.bold((currentTeam && currentTeam.slug) || user.username || user.email)}) ${chalk.gray(`[${elapsed}]`)}`) return secrets.close() } @@ -255,9 +235,8 @@ function readConfirmation(secret) { process.stdout.write('> The following secret will be removed permanently\n') process.stdout.write(' ' + tbl + '\n') - process.stdout.write( - `${chalk.bold.red('> Are you sure?')} ${chalk.gray('[y/N] ')}` - ) + process.stdout + .write(`${chalk.bold.red('> Are you sure?')} ${chalk.gray('[y/N] ')}`) process.stdin .on('data', d => { diff --git a/bin/now-teams.js b/bin/now-teams.js index 6280c40..1a29e5e 100644 --- a/bin/now-teams.js +++ b/bin/now-teams.js @@ -30,8 +30,7 @@ const argv = minimist(process.argv.slice(2), { const subcommand = argv._[0] const help = () => { - console.log( - ` + console.log(` ${chalk.bold(`${logo} now teams`)} ${chalk.dim('Options:')} @@ -68,8 +67,7 @@ const help = () => { ${chalk.cyan(`$ now teams rm `)} ${chalk.gray('–')} If the id is omitted, you can choose interactively - ` - ) + `) } // Options @@ -85,7 +83,7 @@ if (argv.help || !subcommand) { exit(0) } else { Promise.resolve().then(async () => { - const config = await cfg.read({token: argv.token}) + const config = await cfg.read({ token: argv.token }) let token try { @@ -115,17 +113,25 @@ async function run({ token, config: { currentTeam } }) { switch (subcommand) { case 'switch': case 'change': { - await require(resolve(__dirname, 'teams', 'switch.js'))({teams, args, token}) + await require(resolve(__dirname, 'teams', 'switch.js'))({ + teams, + args, + token + }) break } case 'add': case 'create': { - await require(resolve(__dirname, 'teams', 'add.js'))({teams, token}) + await require(resolve(__dirname, 'teams', 'add.js'))({ teams, token }) break } case 'invite': { - await require(resolve(__dirname, 'teams', 'invite.js'))({teams, args, token}) + await require(resolve(__dirname, 'teams', 'invite.js'))({ + teams, + args, + token + }) break } diff --git a/bin/now-upgrade.js b/bin/now-upgrade.js index f1f9ffb..1c8d5f7 100644 --- a/bin/now-upgrade.js +++ b/bin/now-upgrade.js @@ -31,8 +31,7 @@ const argv = minimist(process.argv.slice(2), { }) const help = () => { - console.log( - ` + console.log(` ${chalk.bold(`${logo} now upgrade`)} [plan] ${chalk.dim('Options:')} @@ -55,8 +54,7 @@ const help = () => { ${chalk.gray('–')} Pick a specific plan (premium): ${chalk.cyan(`$ now upgrade premium`)} - ` - ) + `) } // Options @@ -80,7 +78,7 @@ if (argv.help) { exit(0) } else { Promise.resolve().then(async () => { - const config = await cfg.read({token: argv.token}) + const config = await cfg.read({ token: argv.token }) let token try { @@ -213,9 +211,7 @@ async function run({ token, config: { currentTeam, user } }) { newPlan = await plans.set(planId) } catch (err) { if (err.code === 'customer_not_found' || err.code === 'source_not_found') { - error( - `You have no payment methods available. Run ${cmd('now billing add')} to add one` - ) + error(`You have no payment methods available. Run ${cmd('now billing add')} to add one`) } else { error(`An unknow error occured. Please try again later ${err.message}`) } @@ -224,13 +220,9 @@ async function run({ token, config: { currentTeam, user } }) { } if (currentPlan.until && newPlan.id !== 'oss') { - success( - `The cancelation has been undone. You're back on the ${chalk.bold(`${newPlan.name} plan`)}` - ) + success(`The cancelation has been undone. You're back on the ${chalk.bold(`${newPlan.name} plan`)}`) } else if (newPlan.until) { - success( - `Your plan will be switched to ${chalk.bold(newPlan.name)} in ${chalk.bold(newPlan.until)}. Your card will not be charged again` - ) + success(`Your plan will be switched to ${chalk.bold(newPlan.name)} in ${chalk.bold(newPlan.until)}. Your card will not be charged again`) } else { success(`You're now on the ${chalk.bold(`${newPlan.name} plan`)}`) } diff --git a/bin/teams/add.js b/bin/teams/add.js index dbfcc07..165d827 100644 --- a/bin/teams/add.js +++ b/bin/teams/add.js @@ -25,24 +25,20 @@ function validateSlugKeypress(data, value) { function gracefulExit() { console.log() // Blank line - note( - `Your team is now active for all ${cmd('now')} commands!\n Run ${cmd('now switch')} to change it in the future.` - ) + note(`Your team is now active for all ${cmd('now')} commands!\n Run ${cmd('now switch')} to change it in the future.`) return exit() } const teamUrlPrefix = rightPad('Team URL', 14) + chalk.gray('zeit.co/') const teamNamePrefix = rightPad('Team Name', 14) -module.exports = async function({teams, token}) { +module.exports = async function({ teams, token }) { let slug let team let elapsed let stopSpinner - info( - `Pick a team identifier for its url (e.g.: ${chalk.cyan('`zeit.co/acme`')})` - ) + info(`Pick a team identifier for its url (e.g.: ${chalk.cyan('`zeit.co/acme`')})`) do { try { // eslint-disable-next-line no-await-in-loop diff --git a/bin/teams/invite.js b/bin/teams/invite.js index 22815cd..2e1dc40 100644 --- a/bin/teams/invite.js +++ b/bin/teams/invite.js @@ -60,13 +60,10 @@ function emailAutoComplete(value, teamSlug) { return false } -module.exports = async function({ - teams, - args, - token, - introMsg, noopMsg = 'No changes made' -} = {}) { - const { user, currentTeam } = await cfg.read({token}) +module.exports = async function( + { teams, args, token, introMsg, noopMsg = 'No changes made' } = {} +) { + const { user, currentTeam } = await cfg.read({ token }) domains.push(user.email.split('@')[1]) diff --git a/bin/teams/switch.js b/bin/teams/switch.js index 48e3e92..8b9c7f3 100644 --- a/bin/teams/switch.js +++ b/bin/teams/switch.js @@ -15,10 +15,10 @@ async function updateCurrentTeam({ cfg, newTeam } = {}) { await cfg.merge({ currentTeam: newTeam }) } -module.exports = async function({teams, args, token}) { +module.exports = async function({ teams, args, token }) { let stopSpinner = wait('Fetching teams') const list = (await teams.ls()).teams - let { user, currentTeam } = await cfg.read({token}) + let { user, currentTeam } = await cfg.read({ token }) const accountIsCurrent = !currentTeam stopSpinner() diff --git a/lib/cfg.js b/lib/cfg.js index e098924..baf02f7 100644 --- a/lib/cfg.js +++ b/lib/cfg.js @@ -47,7 +47,7 @@ async function read({ force = false, token, apiUrl } = {}) { // Will happen if `force`d or if `--token` is used and it's different from // The one that's stored (which can be `undefined`) - if ((force && token) || (token && token !== existing.token) ) { + if ((force && token) || (token && token !== existing.token)) { const user = await getUser({ token, apiUrl }) if (user) { return { diff --git a/lib/domains.js b/lib/domains.js index 0eeac22..a6da806 100644 --- a/lib/domains.js +++ b/lib/domains.js @@ -72,9 +72,7 @@ module.exports = class Domains extends Now { } if (this._debug) { - console.log( - `> [debug] Supplied domain "${domain}" has non-zeit nameservers` - ) + console.log(`> [debug] Supplied domain "${domain}" has non-zeit nameservers`) } const err3 = new Error(DNS_VERIFICATION_ERROR) diff --git a/lib/index.js b/lib/index.js index dfa7005..2a4aa94 100644 --- a/lib/index.js +++ b/lib/index.js @@ -273,18 +273,12 @@ module.exports = class Now extends EventEmitter { if (!quiet && deploymentType === 'npm' && deployment.nodeVersion) { if (engines && engines.node) { if (missingVersion) { - console.log( - `> Using Node.js ${chalk.bold(deployment.nodeVersion)} (default)` - ) + console.log(`> Using Node.js ${chalk.bold(deployment.nodeVersion)} (default)`) } else { - console.log( - `> Using Node.js ${chalk.bold(deployment.nodeVersion)} (requested: ${chalk.dim(`\`${engines.node}\``)})` - ) + console.log(`> Using Node.js ${chalk.bold(deployment.nodeVersion)} (requested: ${chalk.dim(`\`${engines.node}\``)})`) } } else { - console.log( - `> Using Node.js ${chalk.bold(deployment.nodeVersion)} (default)` - ) + console.log(`> Using Node.js ${chalk.bold(deployment.nodeVersion)} (default)`) } } @@ -349,9 +343,7 @@ module.exports = class Now extends EventEmitter { }) if (this._debug) { - console.timeEnd( - `> [debug] /sync #${attempt} ${names.join(' ')}` - ) + console.timeEnd(`> [debug] /sync #${attempt} ${names.join(' ')}`) } // No retry on 4xx @@ -441,9 +433,8 @@ module.exports = class Now extends EventEmitter { console.time(`> [debug] /deployments/${deploymentId}/instances`) } - const res = await this._fetch( - `/now/deployments/${deploymentId}/instances` - ) + const res = await this + ._fetch(`/now/deployments/${deploymentId}/instances`) if (this._debug) { console.timeEnd(`> [debug] /deployments/${deploymentId}/instances`) @@ -626,19 +617,14 @@ module.exports = class Now extends EventEmitter { this.retry(async (bail, attempt) => { if (this._debug) { - console.time( - `> [debug] #${attempt} GET /whois-ns${fallback ? '-fallback' : ''}` - ) + console.time(`> [debug] #${attempt} GET /whois-ns${fallback ? '-fallback' : ''}`) } - const res = await this._fetch( - `/whois-ns${fallback ? '-fallback' : ''}?domain=${encodeURIComponent(domain)}` - ) + const res = await this + ._fetch(`/whois-ns${fallback ? '-fallback' : ''}?domain=${encodeURIComponent(domain)}`) if (this._debug) { - console.timeEnd( - `> [debug] #${attempt} GET /whois-ns${fallback ? '-fallback' : ''}` - ) + console.timeEnd(`> [debug] #${attempt} GET /whois-ns${fallback ? '-fallback' : ''}`) } const body = await res.json() @@ -904,9 +890,7 @@ module.exports = class Now extends EventEmitter { setScale(nameOrId, scale) { return this.retry(async (bail, attempt) => { if (this._debug) { - console.time( - `> [debug] #${attempt} POST /deployments/${nameOrId}/instances` - ) + console.time(`> [debug] #${attempt} POST /deployments/${nameOrId}/instances`) } const res = await this._fetch(`/now/deployments/${nameOrId}/instances`, { @@ -915,9 +899,7 @@ module.exports = class Now extends EventEmitter { }) if (this._debug) { - console.timeEnd( - `> [debug] #${attempt} POST /deployments/${nameOrId}/instances` - ) + console.timeEnd(`> [debug] #${attempt} POST /deployments/${nameOrId}/instances`) } if (res.status === 403) { diff --git a/lib/login.js b/lib/login.js index 46e1063..454a1ce 100644 --- a/lib/login.js +++ b/lib/login.js @@ -74,14 +74,10 @@ async function register(url, { retryEmail = false } = {}) { } const { token, securityCode } = await getVerificationData(url, email) - console.log( - `> Please follow the link sent to ${chalk.bold(email)} to log in.` - ) + console.log(`> Please follow the link sent to ${chalk.bold(email)} to log in.`) if (securityCode) { - console.log( - `> Verify that the provided security code in the email matches ${chalk.cyan(chalk.bold(securityCode))}.` - ) + console.log(`> Verify that the provided security code in the email matches ${chalk.cyan(chalk.bold(securityCode))}.`) } process.stdout.write('\n') diff --git a/lib/re-alias.js b/lib/re-alias.js index fbcf9a9..60909ea 100644 --- a/lib/re-alias.js +++ b/lib/re-alias.js @@ -21,13 +21,17 @@ exports.assignAlias = async ( user ) => { const aliases = new NowAlias({ apiUrl, token, debug, currentTeam }) - const domains = new NowDomains({apiUrl, token, debug, currentTeam}) - console.log( - `> Assigning alias ${chalk.bold.underline(autoAlias)} to deployment...` - ) + const domains = new NowDomains({ apiUrl, token, debug, currentTeam }) + console.log(`> Assigning alias ${chalk.bold.underline(autoAlias)} to deployment...`) // Assign alias - await aliases.set(String(deployment), String(autoAlias), domains, currentTeam, user) + await aliases.set( + String(deployment), + String(autoAlias), + domains, + currentTeam, + user + ) } exports.reAlias = async ( @@ -50,9 +54,7 @@ exports.reAlias = async ( } if (!fs.existsSync(configFiles.pkg) && !fs.existsSync(configFiles.nowJSON)) { - error( - `Couldn't find a now.json or package.json file with an alias list in it` - ) + error(`Couldn't find a now.json or package.json file with an alias list in it`) return } @@ -84,9 +86,7 @@ exports.reAlias = async ( } else if (Array.isArray(value)) { pointers = pointers.concat(nowConfig.alias) } else { - error( - `Property ${chalk.grey('aliases')} is not a valid array or string` - ) + error(`Property ${chalk.grey('aliases')} is not a valid array or string`) return exit(1) } } diff --git a/lib/scale-info.js b/lib/scale-info.js index 371b4d0..f96c03b 100644 --- a/lib/scale-info.js +++ b/lib/scale-info.js @@ -52,9 +52,7 @@ module.exports = async function(now, url) { if (barcurr === targetReplicaCount) { linelog.clear() - linelog( - `> Scaled to ${chalk.bold(String(targetReplicaCount) + (targetReplicaCount === 1 ? ' instance' : ' instances'))}: ${chalk.gray('[' + ms(Date.now() - startTime) + ']')}\n` - ) + linelog(`> Scaled to ${chalk.bold(String(targetReplicaCount) + (targetReplicaCount === 1 ? ' instance' : ' instances'))}: ${chalk.gray('[' + ms(Date.now() - startTime) + ']')}\n`) return res } } diff --git a/lib/scale.js b/lib/scale.js index ba577f0..5976922 100644 --- a/lib/scale.js +++ b/lib/scale.js @@ -13,9 +13,7 @@ module.exports = class Scale extends Now { }) if (this._debug) { - console.timeEnd( - `> [debug] #${attempt} GET /deployments/${id}/instances` - ) + console.timeEnd(`> [debug] #${attempt} GET /deployments/${id}/instances`) } if (res.status === 403) {