mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
Patch child_process.fork to run .coffee files
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
// Generated by CoffeeScript 1.5.0
|
||||
(function() {
|
||||
var Lexer, compile, ext, fs, helpers, lexer, loadFile, parser, path, vm, _i, _len, _ref,
|
||||
var Lexer, child_process, compile, ext, fs, helpers, lexer, loadFile, parser, path, vm, _i, _len, _ref,
|
||||
__hasProp = {}.hasOwnProperty;
|
||||
|
||||
fs = require('fs');
|
||||
|
||||
path = require('path');
|
||||
|
||||
child_process = require('child_process');
|
||||
|
||||
Lexer = require('./lexer').Lexer;
|
||||
|
||||
parser = require('./parser').parser;
|
||||
@@ -33,6 +35,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
(function(fork) {
|
||||
return child_process.fork = function(modulePath) {
|
||||
var oldExecPath, output;
|
||||
oldExecPath = process.execPath;
|
||||
if (helpers.isCoffee(modulePath)) {
|
||||
process.execPath = 'coffee';
|
||||
}
|
||||
output = fork.apply(this, arguments);
|
||||
process.execPath = oldExecPath;
|
||||
return output;
|
||||
};
|
||||
})(child_process.fork);
|
||||
|
||||
exports.VERSION = '1.5.0';
|
||||
|
||||
exports.helpers = require('./helpers');
|
||||
|
||||
Reference in New Issue
Block a user