Skip to content

Commit

Permalink
Fixing process.argv[0] ... #1303
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Apr 30, 2011
1 parent 0ed8ae2 commit bf8fbc2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion lib/coffee-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
1 change: 1 addition & 0 deletions lib/command.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/coffee-script.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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 '.'
Expand Down
1 change: 1 addition & 0 deletions src/command.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf8fbc2

Please sign in to comment.