Skip to content

Commit ad015ac

Browse files
camelaissaniaudiolion
authored andcommitted
fixed ghauth in order to support "skip stats collection" (microjs#924)
1 parent 2079ffa commit ad015ac

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

lib/ghauth.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,18 @@ function auth (config, callback) {
7777
if (err)
7878
return callback(err)
7979

80-
createAuth(config, function (err) {
81-
if (err)
82-
return callback(err)
83-
fs.writeFileSync(configPath, JSON.stringify({ user: config.ghUser, token: config.ghToken }), 'utf8')
80+
if (config.ghUser) {
81+
createAuth(config, function (err) {
82+
if (err)
83+
return callback(err)
84+
fs.writeFileSync(configPath, JSON.stringify({ user: config.ghUser, token: config.ghToken }), 'utf8')
85+
callback()
86+
})
87+
} else {
88+
console.log('skipped stats collection')
89+
console.log()
8490
callback()
85-
})
91+
}
8692
})
8793
}
8894

0 commit comments

Comments
 (0)