Skip to content

Commit 228d8e4

Browse files
committedNov 19, 2019
More discreet post-install
1 parent bd3f7c8 commit 228d8e4

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed
 

‎jakefile.js

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ publishTask('ejs', ['build'], function () {
6060
'README.md',
6161
'LICENSE',
6262
'package.json',
63+
'postinstall.js',
6364
'ejs.js',
6465
'ejs.min.js',
6566
'lib/**'

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
"node": ">=0.10.0"
3333
},
3434
"scripts": {
35-
"postinstall": "node -e \"console.log('Thank you for installing \\u001b[35mEJS\\u001b[0m: built with the \\u001b[32mJake\\u001b[0m JavaScript build tool (\\u001b[32mhttps://jakejs.com/\\u001b[0m)\\n');\""
35+
"postinstall": "node ./postinstall.js"
3636
}
3737
}

‎postinstall.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env node
2+
3+
function isTrue(value) {
4+
return !!value && value !== '0' && value !== 'false';
5+
}
6+
7+
let envDisable = isTrue(process.env.DISABLE_OPENCOLLECTIVE) || isTrue(process.env.CI);
Has conversations. Original line has conversations.
8+
let logLevel = process.env.npm_config_loglevel;
9+
let logLevelDisplay = ['silent', 'error', 'warn'].indexOf(logLevel) > -1;
10+
11+
if (!envDisable && !logLevelDisplay) {
12+
console.log('Thank you for installing \u001b[35mEJS\u001b[0m: built with the \u001b[32mJake\u001b[0m JavaScript build tool (\u001b[32mhttps://jakejs.com/\u001b[0m)\n');
13+
}
14+
15+

0 commit comments

Comments
 (0)
Please sign in to comment.