Skip to content

Commit 08d60a0

Browse files
committed
use chalk instead
1 parent 109c953 commit 08d60a0

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"repl.js"
2929
],
3030
"scripts": {
31-
"postinstall": "node --eval \"if (require('./package.json').name === 'coffee-script') { var red, yellow, cyan, reset; red = yellow = cyan = reset = ''; if (!process.env.NODE_DISABLE_COLORS) { red = '\\x1b[31m'; yellow = '\\x1b[33m'; cyan = '\\x1b[36m'; reset = '\\x1b[0m'; } console.warn(red + 'CoffeeScript has moved!' + reset + ' Please update references to ' + yellow + '\\\"coffee-script\\\"' + reset + ' to use ' + yellow + '\\\"coffeescript\\\"' + reset + ' (no hyphen) instead.'); console.warn('Also, a new major version has been released under the ' + yellow + 'coffeescript' + reset + ' name on NPM. This new release targets modern JavaScript, with minimal breaking changes. Learn more at ' + cyan + 'http://coffeescript.org' + reset + '.'); console.warn(''); }\"",
31+
"postinstall": "node ./warning.js",
3232
"test": "node ./bin/cake test",
3333
"test-harmony": "node --harmony ./bin/cake test"
3434
},
@@ -45,5 +45,8 @@
4545
"jison": "~0.4.18",
4646
"markdown-it": "~8.4.0",
4747
"underscore": "~1.8.3"
48+
},
49+
"dependencies": {
50+
"chalk": "^2.3.0"
4851
}
4952
}

warning.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const chalk = require('chalk');
2+
if (require('./package.json').name === 'coffee-script') {
3+
// var red, yellow, cyan, reset; red = yellow = cyan = reset = '';
4+
// if (!process.env.NODE_DISABLE_COLORS) {
5+
// red = '\\x1b[31m';
6+
// yellow = '\\x1b[33m';
7+
// cyan = '\\x1b[36m';
8+
// reset = '\\x1b[0m';
9+
// }
10+
console.warn(chalk.red('CoffeeScript has moved!') + ' Please update references to ' + chalk.yellow('coffee-script') + ' to use ' + chalk.yellow('coffeescript') + ' (no hyphen) instead.');
11+
console.warn('Also, a new major version has been released under the ' + chalk.yellow('coffeescript') + ' name on NPM. This new release targets modern JavaScript, with minimal breaking changes. Learn more at ' + chalk.cyan('http://coffeescript.org') + '.');
12+
console.warn('');
13+
}

0 commit comments

Comments
 (0)