Skip to content

Commit

Permalink
fix(cli): add heroku env var warnings to version (#1024)
Browse files Browse the repository at this point in the history
  • Loading branch information
RasPhilCo committed Sep 18, 2018
1 parent 425ee0a commit cf531e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/cli/package.json
Expand Up @@ -221,7 +221,8 @@
},
"hooks": {
"init": [
"./lib/hooks/init/refresh"
"./lib/hooks/init/refresh",
"./lib/hooks/init/version"
],
"prerun": [
"./lib/hooks/prerun/analytics"
Expand Down
12 changes: 12 additions & 0 deletions packages/cli/src/hooks/init/version.ts
@@ -0,0 +1,12 @@
import {Hook} from '@oclif/config'

export const migrate: Hook<'init'> = async function () {
if (['-v', '--version', 'version'].includes(process.argv[2])) {
for (let envs of Object.keys(process.env)) {
if (envs.match(/^HEROKU_/) && envs !== 'HEROKU_UPDATE_INSTRUCTIONS') {
let value = envs === 'HEROKU_API_KEY' ? 'to [REDACTED]' : `to ${process.env[envs]}`
this.warn(`${envs} set ${value}`)
}
}
}
}

0 comments on commit cf531e4

Please sign in to comment.