Skip to content
This repository was archived by the owner on Aug 10, 2020. It is now read-only.

Commit 9f9afe3

Browse files
committed
add arg parser to base command
1 parent a285a08 commit 9f9afe3

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

package-lock.json

Lines changed: 19 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
"lodash.merge": "^4.6.1",
8383
"lodash.snakecase": "^4.1.1",
8484
"make-dir": "^1.3.0",
85+
"minimist": "^1.2.0",
8586
"netlify": "^2.2.1",
8687
"node-fetch": "^2.3.0",
8788
"uuid": "^3.3.2",

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const openBrowser = require('./utils/open-browser')
99
const findRoot = require('./utils/find-root')
1010
const { track, identify } = require('./utils/telemetry')
1111
const merge = require('lodash.merge')
12+
const argv = require('minimist')(process.argv.slice(2))
1213
const { NETLIFY_AUTH_TOKEN } = process.env
1314

1415
// Netlify CLI client id. Lives in bot@netlify.com
@@ -23,7 +24,7 @@ class BaseCommand extends Command {
2324
async init(err) {
2425
const projectRoot = findRoot(process.cwd())
2526
// Grab netlify API token
26-
const [ token ] = this.getConfigToken()
27+
const [ token ] = this.getConfigToken(argv.auth)
2728
// Get site config from netlify.toml
2829
const configPath = getConfigPath(projectRoot)
2930
// TODO: https://github.com/request/caseless to handle key casing issues

0 commit comments

Comments
 (0)