Browse Source

Now able to debug and set a API URL

master
Leo Lamprecht 8 years ago
parent
commit
36a2fee6e6
  1. 9
      src/providers/sh/commands/bin/alias.js
  2. 11
      src/providers/sh/commands/bin/list.js
  3. 16
      src/providers/sh/commands/bin/scale.js

9
src/providers/sh/commands/bin/alias.js

@ -26,7 +26,6 @@ const promptBool = require('../lib/utils/input/prompt-bool')
const grayWidth = 10
const underlineWidth = 11
// Options
const help = () => {
console.log(`
${chalk.bold(`${logo} now alias`)} <ls | set | rm> <deployment> <alias>
@ -111,11 +110,10 @@ const help = () => {
}
// Options
const debug = false
const apiUrl = 'https://api.zeit.co'
let argv
let subcommand
let debug
let apiUrl
const main = async ctx => {
argv = minimist(ctx.argv.slice(2), {
@ -133,6 +131,9 @@ const main = async ctx => {
argv._ = argv._.slice(1)
subcommand = argv._[0]
debug = argv.debug
apiUrl = argv.apiUrl || 'https://api.zeit.co'
if (argv.help) {
help()
process.exit(0)

11
src/providers/sh/commands/bin/list.js

@ -16,8 +16,6 @@ const { handleError, error } = require('../lib/error')
const logo = require('../lib/utils/output/logo')
const sort = require('../lib/sort-deployments')
let argv
const help = () => {
console.log(`
${chalk.bold(`${logo} now list`)} [app]
@ -47,10 +45,11 @@ const help = () => {
`)
}
const debug = false
const apiUrl = 'https://api.zeit.co'
// Options
let app
let argv
let debug
let apiUrl
const main = async ctx => {
argv = minimist(ctx.argv.slice(2), {
@ -65,6 +64,8 @@ const main = async ctx => {
})
app = argv._[1]
debug = argv.debug
apiUrl = argv.apiUrl || 'https://api.zeit.co'
if (argv.help) {
help()

16
src/providers/sh/commands/bin/scale.js

@ -20,11 +20,6 @@ const info = require('../lib/scale-info')
const sort = require('../lib/sort-deployments')
const success = require('../lib/utils/output/success')
let id
let scaleArg
let optionalScaleArg
// Options
const help = () => {
console.log(`
${chalk.bold(`${logo} now scale`)} ls
@ -70,10 +65,13 @@ const help = () => {
}
// Options
const debug = false
const apiUrl = 'https://api.zeit.co'
let argv
let debug
let apiUrl
let id
let scaleArg
let optionalScaleArg
const main = async ctx => {
argv = minimist(ctx.argv.slice(2), {
@ -87,6 +85,8 @@ const main = async ctx => {
id = argv._[0]
scaleArg = argv._[1]
optionalScaleArg = argv._[2]
apiUrl = argv.url || 'https://api.zeit.co'
debug = argv.debug
if (argv.help) {
help()

Loading…
Cancel
Save