Skip to content

Commit

Permalink
Simplify preflight-check
Browse files Browse the repository at this point in the history
  • Loading branch information
nonword committed Apr 28, 2023
1 parent 1bc6c5b commit 72ac886
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/preflight_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ const requiredEnvVars = [
'NYPL_OAUTH_SECRET',
]

const undefinedVars = requiredEnvVars.reduce((undefinedVars, varName) => {
if (!process.env[varName]) {
undefinedVars.push(varName)
}
return undefinedVars
}, [])
const undefinedVars = requiredEnvVars
.filter((varName) => !process.env[varName])

if (undefinedVars.length > 0) {
let message = `The following ENV_VAR(S) must be defined: ${undefinedVars.join(', ')}.`
Expand Down

0 comments on commit 72ac886

Please sign in to comment.