mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
993347bb8a
* Don’t prefer global installation; the `coffee` or `cake` commands should try to run the locally-installed module if it exists, or the global version otherwise * Style
18 lines
542 B
JavaScript
Executable file
18 lines
542 B
JavaScript
Executable file
#!/usr/bin/env node
|
|
|
|
var path = require('path');
|
|
var fs = require('fs');
|
|
|
|
var potentialPaths = [
|
|
path.join(process.cwd(), 'node_modules/coffeescript/lib/coffeescript'),
|
|
path.join(process.cwd(), 'node_modules/coffeescript/lib/coffee-script'),
|
|
path.join(process.cwd(), 'node_modules/coffee-script/lib/coffee-script'),
|
|
path.join(__dirname, '../lib/coffeescript')
|
|
];
|
|
|
|
for (var i = 0, len = potentialPaths.length; i < len; i++) {
|
|
if (fs.existsSync(potentialPaths[i])) {
|
|
require(potentialPaths[i] + '/cake').run();
|
|
break;
|
|
}
|
|
}
|