cake 543 B

123456789101112131415161718
  1. #!/usr/bin/env node
  2. var path = require('path');
  3. var fs = require('fs');
  4. var potentialPaths = [
  5. path.join(process.cwd(), 'node_modules/coffeescript/lib/coffeescript'),
  6. path.join(process.cwd(), 'node_modules/coffeescript/lib/coffee-script'),
  7. path.join(process.cwd(), 'node_modules/coffee-script/lib/coffee-script'),
  8. path.join(__dirname, '../lib/coffee-script')
  9. ];
  10. for (var i = 0, len = potentialPaths.length; i < len; i++) {
  11. if (fs.existsSync(potentialPaths[i])) {
  12. require(potentialPaths[i] + '/cake').run();
  13. break;
  14. }
  15. }