@ -184,9 +182,7 @@ 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`)
}
@ -246,9 +242,7 @@ async function run({ token, config: { currentTeam, user } }) {
@ -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`')}`)
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()
@ -168,9 +162,7 @@ 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]
@ -179,9 +171,7 @@ async function run({ token, config: { currentTeam, user } }) {
`> ${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.`)
`${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)})`)
@ -119,7 +117,7 @@ if (argv.help || !subcommand) {
exit(0)
}else{
Promise.resolve().then(async()=>{
constconfig=awaitcfg.read({token:argv.token})
constconfig=awaitcfg.read({token:argv.token})
lettoken
try{
@ -183,9 +181,7 @@ async function run({ token, config: { currentTeam, user } }) {
)
constelapsed_=ms(newDate()-start_)
console.log(
`> ${domains.length} domain${domains.length===1?'':'s'} found under ${chalk.bold((currentTeam&¤tTeam.slug)||user.username||user.email)}${chalk.gray(`[${elapsed_}]`)}`
)
console.log(`> ${domains.length} domain${domains.length===1?'':'s'} found under ${chalk.bold((currentTeam&¤tTeam.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 } }) {
`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)
}
@ -126,9 +122,7 @@ 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)}`)
${chalk.bold(`${logo} now secrets`)}<ls|add|rename|rm><secret>
${chalk.dim('Options:')}
@ -70,8 +69,7 @@ const help = () => {
${chalk.gray('–')}Removesasecret:
${chalk.cyan(`$ now secrets rm my-secret`)}
`
)
`)
}
// Options
@ -87,7 +85,7 @@ if (argv.help || !subcommand) {
exit(0)
}else{
Promise.resolve().then(async()=>{
constconfig=awaitcfg.read({token:argv.token})
constconfig=awaitcfg.read({token:argv.token})
lettoken
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`')}`)
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()
@ -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 <id | name>`')}`
)
error(`Invalid number of arguments. Usage: ${chalk.cyan('`now secret rm <id | name>`')}`)
returnexit(1)
}
constlist=awaitsecrets.ls()
@ -179,38 +171,28 @@ async function run({ token, config: { currentTeam, user } }) {