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

Commit d325599

Browse files
committed
add docs to function
1 parent 5b080b3 commit d325599

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class BaseCommand extends Command {
2323
const projectRoot = findRoot(process.cwd())
2424
// Grab netlify API token
2525
const token = getConfigToken()
26-
2726
// Get site config from netlify.toml
2827
const configPath = getConfigPath(projectRoot)
2928
// TODO: https://github.com/request/caseless to handle key casing issues
@@ -72,8 +71,8 @@ class BaseCommand extends Command {
7271
}
7372
}
7473

75-
async authenticate(authToken) {
76-
const token = getConfigToken(authToken)
74+
async authenticate(authTokenFromFlag) {
75+
const token = getConfigToken(authTokenFromFlag)
7776
if (!token) {
7877
return this.expensivelyAuthenticate()
7978
} else {
@@ -147,6 +146,11 @@ class BaseCommand extends Command {
147146
}
148147
}
149148

149+
/**
150+
* Get user netlify API token
151+
* @param {string} authTokenFromFlag - value passed in by CLI flag
152+
* @return {string} - resolved Netlify API token
153+
*/
150154
function getConfigToken(authTokenFromFlag) {
151155
// 1. First honor command flag --auth
152156
if (authTokenFromFlag) {

0 commit comments

Comments
 (0)