Skip to content

Commit

Permalink
Merge pull request node-js-libs#105 from Akkuma/master
Browse files Browse the repository at this point in the history
Support for various Coffee based compilers
  • Loading branch information
chriso committed May 31, 2012
2 parents adc39f6 + 61b67c2 commit 7fa74c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions lib/node.io/interfaces/cli.js
Expand Up @@ -30,6 +30,7 @@ var usage = ''
+ ' -g, --debug Debug the operation\n'
+ ' -v, --version Display the current version\n'
+ ' -h, --help Display help information\n'
+ ' -c, --compiler Set an alternate compiler to use\n'
;

/**
Expand Down Expand Up @@ -118,6 +119,10 @@ exports.cli = function (args, exit) {
case '--unpack':
options.unpack = args.shift();
break;
case '-c':
case '--compiler':
options.compiler = args.shift();
break;
default:
job_path = arg;
if (args.length) {
Expand Down
2 changes: 1 addition & 1 deletion lib/node.io/processor.js
Expand Up @@ -335,7 +335,7 @@ Processor.prototype.loadJob = function (job, options, callback) {
//If we're the master, compile and load the .coffee file
this.status('Compiling ' + job + ' => ' + compiled_js, 'debug');

utils.compileCoffee(job, compiled_js, function(err) {
utils.compile(options.compiler || 'coffee', job, compiled_js, function(err) {
if (err) {
callback(err);
} else {
Expand Down
4 changes: 2 additions & 2 deletions lib/node.io/utils.js
Expand Up @@ -78,8 +78,8 @@ exports.removeOnExit = function (file) {
* @param {Function} callback
* @api public
*/
exports.compileCoffee = function (coffee_file, compiled_file, callback) {
exec('coffee -p -c "' + coffee_file + '"', {cwd: cwd}, function (err, stdout, stderr) {
exports.compile = function (compiler, coffee_file, compiled_file, callback) {
exec(compiler + ' -p -c "' + coffee_file + '"', {cwd: cwd}, function (err, stdout, stderr) {
if (err || stderr) {
callback(err || stderr);
} else {
Expand Down

0 comments on commit 7fa74c1

Please sign in to comment.