Skip to content

Commit 4f0e7ca

Browse files
benjamingrnodkz
authored andcommitted
refactor: clean up skipDownload code
* clean up skipDownload code We were trying to figure out why this doesn't work (before 2.7.3 in the postinstall) and found this code confusing so I figured I'd contribute back and clean it up (thanks for the library!) * Avoid includes
1 parent d1f73ed commit 4f0e7ca

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

postinstall.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ function isModuleExists(name) {
1313
catch(e) { return false }
1414
}
1515

16-
const skipDownload = typeof process.env.MONGOMS_DISABLE_POSTINSTALL === 'string'
17-
? ['1', 'on', 'yes', 'true'].indexOf(process.env.MONGOMS_DISABLE_POSTINSTALL.toLowerCase()) !== -1
18-
: false;
16+
const skipDownload = (typeof process.env.MONGOMS_DISABLE_POSTINSTALL === 'string') &&
17+
(['1', 'on', 'yes', 'true'].indexOf(process.env.MONGOMS_DISABLE_POSTINSTALL.toLowerCase()) !== -1)
1918

2019
if (skipDownload) {
2120
console.log("Download is skipped by MONGOMS_DISABLE_POSTINSTALL variable");

0 commit comments

Comments
 (0)