mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Fixing process.argv[0] ... #1303
This commit is contained in:
parent
0ed8ae28e7
commit
bf8fbc2c0e
4 changed files with 2 additions and 4 deletions
|
@ -50,7 +50,6 @@
|
|||
while (root.parent) {
|
||||
root = root.parent;
|
||||
}
|
||||
process.argv[0] = 'coffee';
|
||||
root.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '.';
|
||||
if (root.moduleCache) {
|
||||
root.moduleCache = {};
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
opts.literals = sources.splice(1).concat(opts.literals);
|
||||
}
|
||||
process.ARGV = process.argv = process.argv.slice(0, 2).concat(opts.literals);
|
||||
process.argv[0] = 'coffee';
|
||||
return compileScripts();
|
||||
};
|
||||
compileScripts = function() {
|
||||
|
|
|
@ -59,9 +59,6 @@ exports.run = (code, options) ->
|
|||
while root.parent
|
||||
root = root.parent
|
||||
|
||||
# Set the process command to `coffee`
|
||||
process.argv[0] = 'coffee'
|
||||
|
||||
# Set the filename.
|
||||
root.filename = process.argv[1] =
|
||||
if options.filename then fs.realpathSync(options.filename) else '.'
|
||||
|
|
|
@ -66,6 +66,7 @@ exports.run = ->
|
|||
if opts.run
|
||||
opts.literals = sources.splice(1).concat opts.literals
|
||||
process.ARGV = process.argv = process.argv.slice(0, 2).concat opts.literals
|
||||
process.argv[0] = 'coffee'
|
||||
compileScripts()
|
||||
|
||||
# Asynchronously read in each CoffeeScript in a list of source files and
|
||||
|
|
Loading…
Reference in a new issue