diff --git a/lib/coffee-script.js b/lib/coffee-script.js index 378f5624d6..f26fc63bd1 100755 --- a/lib/coffee-script.js +++ b/lib/coffee-script.js @@ -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 = {}; diff --git a/src/coffee-script.coffee b/src/coffee-script.coffee index f2e6713fdd..67148ce251 100755 --- a/src/coffee-script.coffee +++ b/src/coffee-script.coffee @@ -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 '.'