Skip to content

Commit 1af8c07

Browse files
committed
site update & icons update
1 parent 57a9eaf commit 1af8c07

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

scripts/postinstall.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* eslint-disable max-len */
2+
const emoji = require('node-emoji');
3+
4+
const env = process.env;
5+
const ADBLOCK = is(env.ADBLOCK);
6+
const CI = is(env.CI);
7+
const COLOR = is(env.npm_config_color);
8+
const DISABLE_OPENCOLLECTIVE = is(env.DISABLE_OPENCOLLECTIVE);
9+
const SILENT = !!~['silent', 'error', 'warn'].indexOf(env.npm_config_loglevel);
10+
11+
function is(it) {
12+
return !!it && it !== '0' && it !== 'false';
13+
}
14+
15+
function log(it) {
16+
// eslint-disable-next-line no-console,no-control-regex
17+
console.log(COLOR ? it : it.replace(/\u001B\[\d+m/g, ''));
18+
}
19+
20+
if (!ADBLOCK && !CI && !DISABLE_OPENCOLLECTIVE && !SILENT) {
21+
log(
22+
'\u001B[96mThank you for using ant-design-vue (\u001B[94m https://github.com/vueComponent/ant-design-vue \u001B[96m)!\u001B[0m\n',
23+
);
24+
log(
25+
'\u001B[96mThe project needs your help! Please consider supporting of ant-design-vue on Open Collective or Patreon: ' +
26+
emoji.get('pray') +
27+
'\u001B[0m',
28+
);
29+
log('\u001B[96m>\u001B[94m https://opencollective.com/ant-design-vue \u001B[0m');
30+
log('\u001B[96m>\u001B[94m https://www.patreon.com/tangjinzhou \u001B[0m\n');
31+
log(
32+
'\u001B[96mFor china, 更多赞助方式(支付宝、微信)请查看如下链接: ' +
33+
emoji.get('pray') +
34+
'\u001B[0m',
35+
);
36+
log('\u001B[96m>\u001B[94m https://ant-design-vue.gitee.io/docs/vue/sponsor-cn \u001B[0m\n');
37+
}

0 commit comments

Comments
 (0)