Skip to content

Commit d3a74b5

Browse files
committed
Throw warning for unsupported runtimes, e.g. Node < 6
1 parent 12fcbfc commit d3a74b5

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

bin/cake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/usr/bin/env node
22

3+
try {
4+
new Function('var {a} = {a: 1}')();
5+
} catch (error) {
6+
console.error('Your JavaScript runtime does not support some features used by the cake command. Please use Node 6 or later.');
7+
process.exit(1);
8+
}
9+
310
var path = require('path');
411
var fs = require('fs');
512

bin/coffee

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/usr/bin/env node
22

3+
try {
4+
new Function('var {a} = {a: 1}')();
5+
} catch (error) {
6+
console.error('Your JavaScript runtime does not support some features used by the coffee command. Please use Node 6 or later.');
7+
process.exit(1);
8+
}
9+
310
var path = require('path');
411
var fs = require('fs');
512

0 commit comments

Comments
 (0)