1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

Fix a typo causing module.paths to be always set as the cwd.

`options.fileName` was used instead of `options.filename`.
This commit is contained in:
Geoffry Song 2014-01-29 13:23:19 -05:00
parent a73a6e24a6
commit 38bd879a9a
2 changed files with 2 additions and 2 deletions

View file

@ -110,7 +110,7 @@
mainModule = require.main;
mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '.';
mainModule.moduleCache && (mainModule.moduleCache = {});
dir = options.fileName ? path.dirname(fs.realpathSync(options.filename)) : fs.realpathSync('.');
dir = options.filename ? path.dirname(fs.realpathSync(options.filename)) : fs.realpathSync('.');
mainModule.paths = require('module')._nodeModulePaths(dir);
if (!helpers.isCoffee(mainModule.filename) || require.extensions) {
answer = compile(code, options);

View file

@ -107,7 +107,7 @@ exports.run = (code, options = {}) ->
mainModule.moduleCache and= {}
# Assign paths for node_modules loading
dir = if options.fileName
dir = if options.filename
path.dirname fs.realpathSync options.filename
else
fs.realpathSync '.'