@ -181,7 +181,9 @@ async function run({ token, config: { currentTeam, user } }) {
}
break
}elseif(args.length!==0){
error(`Invalid number of arguments. Usage: ${chalk.cyan('`now alias ls`')}`)
error(
`Invalid number of arguments. Usage: ${chalk.cyan('`now alias ls`')}`
)
returnexit(1)
}
@ -203,7 +205,9 @@ async function run({ token, config: { currentTeam, user } }) {
returnMath.max(acc,(i.alias&&i.alias.length)||0)
},0)+8
constelapsed_=ms(newDate()-start_)
console.log(`> ${aliases.length} alias${aliases.length===1?'':'es'} found ${chalk.gray(`[${elapsed_}]`)} under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}`)
console.log(
`> ${aliases.length} alias${aliases.length===1?'':'es'} found ${chalk.gray(`[${elapsed_}]`)} under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}`
)
console.log()
if(supportsColor){
@ -248,7 +252,9 @@ async function run({ token, config: { currentTeam, user } }) {
@ -182,7 +182,9 @@ async function run({ token, config: { currentTeam, user } }) {
.join('\n\n')
constelapsed=ms(newDate()-start)
console.log(`> ${cards.cards.length} card${cards.cards.length===1?'':'s'} found under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}${chalk.gray(`[${elapsed}]`)}`)
console.log(
`> ${cards.cards.length} card${cards.cards.length===1?'':'s'} found under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}${chalk.gray(`[${elapsed}]`)}`
)
if(text){
console.log(`\n${text}\n`)
}
@ -242,7 +244,9 @@ async function run({ token, config: { currentTeam, user } }) {
@ -114,14 +114,18 @@ 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`')}`
)
returnexit(1)
}
constlist=awaitcerts.ls()
constelapsed=ms(newDate()-start)
console.log(`> ${list.length} certificate${list.length===1?'':'s'} found ${chalk.gray(`[${elapsed}]`)} under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}`)
console.log(
`> ${list.length} certificate${list.length===1?'':'s'} found ${chalk.gray(`[${elapsed}]`)} under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}`
)
if(list.length>0){
constcur=Date.now()
@ -162,7 +166,9 @@ async function run({ token, config: { currentTeam, user } }) {
}
}elseif(subcommand==='create'){
if(args.length!==1){
error(`Invalid number of arguments. Usage: ${chalk.cyan('`now certs create <cn>`')}`)
error(
`Invalid number of arguments. Usage: ${chalk.cyan('`now certs create <cn>`')}`
)
returnexit(1)
}
constcn=args[0]
@ -171,7 +177,9 @@ async function run({ token, config: { currentTeam, user } }) {
console.log(`> ${count} record${count===1?'':'s'} found ${chalk.gray(`[${elapsed}]`)} under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}`)
console.log(
`> ${count} record${count===1?'':'s'} found ${chalk.gray(`[${elapsed}]`)} under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}`
)
console.log(text.join(''))
}elseif(subcommand==='add'){
constparam=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.`
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&¤tTeam.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&¤tTeam.slug)||user.username||user.email)})`
console.log(`No deployments found for ${chalk.bold(pkg.name)} under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}`)
console.log(
`No deployments found for ${chalk.bold(pkg.name)} under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}`
)
process.exit(0)
}
@ -122,7 +124,9 @@ async function open({ token, config: { currentTeam, user } }) {
try{
consturl=`https://${latestDeploy.url}`
console.log(`Opening the latest deployment for ${chalk.bold(pkg.name)}... under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}`)
console.log(
`Opening the latest deployment for ${chalk.bold(pkg.name)}... under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}`
)
console.log(`Here's the URL: ${chalk.underline(url)}`)
@ -111,14 +111,18 @@ 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`')}`
)
returnexit(1)
}
constlist=awaitsecrets.ls()
constelapsed=ms(newDate()-start)
console.log(`> ${list.length} secret${list.length===1?'':'s'} found under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}${chalk.gray(`[${elapsed}]`)}`)
console.log(
`> ${list.length} secret${list.length===1?'':'s'} found under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}${chalk.gray(`[${elapsed}]`)}`
)
if(list.length>0){
constcur=Date.now()
@ -150,7 +154,9 @@ 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 <id | name>`')}`)
error(
`Invalid number of arguments. Usage: ${chalk.cyan('`now secret rm <id | name>`')}`
)
returnexit(1)
}
constlist=awaitsecrets.ls()
@ -171,28 +177,38 @@ async function run({ token, config: { currentTeam, user } }) {
@ -405,7 +425,9 @@ module.exports = class Alias extends Now {
}
if(code==='cert_missing'){
console.log(`> Provisioning certificate for ${chalk.underline(chalk.bold(alias))}`)
console.log(
`> Provisioning certificate for ${chalk.underline(chalk.bold(alias))}`
)
try{
awaitthis.createCert(alias)
@ -421,7 +443,9 @@ module.exports = class Alias extends Now {
}
if(code==='cert_expired'){
console.log(`> Renewing certificate for ${chalk.underline(chalk.bold(alias))}`)
console.log(
`> Renewing certificate for ${chalk.underline(chalk.bold(alias))}`
)
try{
awaitthis.createCert(alias,{renew:true})
@ -523,8 +547,12 @@ module.exports = class Alias extends Now {
if(canBePurchased){
constprice=awaitpricePromise
info(`The domain ${aliasParam} is ${chalk.bold('available for purchase')}! ${elapsed()}`)
constconfirmation=awaitpromptBool(`Buy now for ${chalk.bold(`$${price}`)} (${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)})?`)
info(
`The domain ${aliasParam} is ${chalk.bold('available for purchase')}! ${elapsed()}`
)
constconfirmation=awaitpromptBool(
`Buy now for ${chalk.bold(`$${price}`)} (${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)})?`
)
eraseLines(1)
if(!confirmation){
info('Aborted')
@ -563,12 +591,16 @@ module.exports = class Alias extends Now {
error(
'The nameservers are pending propagation. Please try again shortly'
)
info(`The ${tld} servers might take some extra time to reflect changes`)
info(
`The ${tld} servers might take some extra time to reflect changes`
)
gracefulExit()
}
}
console.log(`> Verifying the DNS settings for ${chalk.bold(chalk.underline(alias))} (see ${chalk.underline('https://zeit.world')} for help)`)
console.log(
`> Verifying the DNS settings for ${chalk.bold(chalk.underline(alias))} (see ${chalk.underline('https://zeit.world')} for help)`
)
const_domain=publicSuffixList.parse(alias).domain
const_domainInfo=awaitthis.getDomain(_domain)
@ -585,9 +617,13 @@ module.exports = class Alias extends Now {
if(this._debug){
if(domainInfo){
console.log(`> [debug] Found domain ${domain} with verified:${domainInfo.verified}`)
console.log(
`> [debug] Found domain ${domain} with verified:${domainInfo.verified}`
)
}else{
console.log(`> [debug] Found domain ${domain} and nameservers ${nameservers}`)
console.log(
`> [debug] Found domain ${domain} and nameservers ${nameservers}`
)
}
}
@ -605,7 +641,9 @@ module.exports = class Alias extends Now {