Skip to content

Commit

Permalink
merging #1303 ... setting process.argv[0] to coffee for coffee's run.
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Apr 30, 2011
2 parents f76ad89 + fe889b8 commit 0ed8ae2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/coffee-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
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
4 changes: 4 additions & 0 deletions src/coffee-script.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ exports.run = (code, options) ->
root = module
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

0 comments on commit 0ed8ae2

Please sign in to comment.