Skip to content
This repository
Browse code

Merge pull request #105 from Akkuma/master

Support for various Coffee based compilers
  • Loading branch information...
commit 7fa74c1e930d075e10a359b40bd3647207d1bafa 2 parents adc39f6 + 61b67c2
Chris O'Hara authored
5 lib/node.io/interfaces/cli.js
@@ -30,6 +30,7 @@ var usage = ''
30 30 + ' -g, --debug Debug the operation\n'
31 31 + ' -v, --version Display the current version\n'
32 32 + ' -h, --help Display help information\n'
  33 + + ' -c, --compiler Set an alternate compiler to use\n'
33 34 ;
34 35
35 36 /**
@@ -118,6 +119,10 @@ exports.cli = function (args, exit) {
118 119 case '--unpack':
119 120 options.unpack = args.shift();
120 121 break;
  122 + case '-c':
  123 + case '--compiler':
  124 + options.compiler = args.shift();
  125 + break;
121 126 default:
122 127 job_path = arg;
123 128 if (args.length) {
2  lib/node.io/processor.js
@@ -335,7 +335,7 @@ Processor.prototype.loadJob = function (job, options, callback) {
335 335 //If we're the master, compile and load the .coffee file
336 336 this.status('Compiling ' + job + ' => ' + compiled_js, 'debug');
337 337
338   - utils.compileCoffee(job, compiled_js, function(err) {
  338 + utils.compile(options.compiler || 'coffee', job, compiled_js, function(err) {
339 339 if (err) {
340 340 callback(err);
341 341 } else {
4 lib/node.io/utils.js
@@ -78,8 +78,8 @@ exports.removeOnExit = function (file) {
78 78 * @param {Function} callback
79 79 * @api public
80 80 */
81   -exports.compileCoffee = function (coffee_file, compiled_file, callback) {
82   - exec('coffee -p -c "' + coffee_file + '"', {cwd: cwd}, function (err, stdout, stderr) {
  81 +exports.compile = function (compiler, coffee_file, compiled_file, callback) {
  82 + exec(compiler + ' -p -c "' + coffee_file + '"', {cwd: cwd}, function (err, stdout, stderr) {
83 83 if (err || stderr) {
84 84 callback(err || stderr);
85 85 } else {

0 comments on commit 7fa74c1

Please sign in to comment.
Something went wrong with that request. Please try again.