Browse Source
Proper name for command used for opening last deployment
master
Leo Lamprecht
8 years ago
No known key found for this signature in database
GPG Key ID: B08517883D5E0E10
2 changed files with
6 additions and
6 deletions
-
bin/now-open.js
-
bin/now.js
|
|
@ -26,7 +26,7 @@ const argv = minimist(process.argv.slice(2), { |
|
|
|
|
|
|
|
const help = () => { |
|
|
|
console.log(` |
|
|
|
${chalk.bold(`${logo} now browse`)} |
|
|
|
${chalk.bold(`${logo} now open`)} |
|
|
|
|
|
|
|
${chalk.dim('Options:')} |
|
|
|
|
|
|
@ -37,9 +37,9 @@ const help = () => { |
|
|
|
|
|
|
|
${chalk.dim('Examples:')} |
|
|
|
|
|
|
|
${chalk.gray('–')} Open latest deployment for current app |
|
|
|
${chalk.gray('–')} Open latest deployment for current project |
|
|
|
|
|
|
|
${chalk.cyan('$ now browse')} |
|
|
|
${chalk.cyan('$ now open')} |
|
|
|
|
|
|
|
`)
|
|
|
|
} |
|
|
@ -64,7 +64,7 @@ const config = cfg.read() |
|
|
|
Promise.resolve(argv.token || config.token || login(apiUrl)) |
|
|
|
.then(async token => { |
|
|
|
try { |
|
|
|
await browse(token) |
|
|
|
await open(token) |
|
|
|
} catch (err) { |
|
|
|
error(`Unknown error: ${err}\n${err.stack}`) |
|
|
|
process.exit(1) |
|
|
@ -75,7 +75,7 @@ Promise.resolve(argv.token || config.token || login(apiUrl)) |
|
|
|
process.exit(1) |
|
|
|
}) |
|
|
|
|
|
|
|
async function browse(token) { |
|
|
|
async function open(token) { |
|
|
|
const now = new Now(apiUrl, token, {debug}) |
|
|
|
|
|
|
|
let deployments |
|
|
@ -55,7 +55,7 @@ const commands = new Set([ |
|
|
|
'billing', |
|
|
|
'upgrade', |
|
|
|
'downgrade', |
|
|
|
'browse' |
|
|
|
'open' |
|
|
|
]) |
|
|
|
|
|
|
|
const aliases = new Map([ |
|
|
|