fixing missing file finding logic for litcoffee

This commit is contained in:
Jeremy Ashkenas
2013-01-16 17:33:54 +11:00
parent d11fa573e6
commit 316d5e5e77
2 changed files with 2 additions and 2 deletions

View File

@@ -100,7 +100,7 @@
throw err;
}
if ((err != null ? err.code : void 0) === 'ENOENT') {
if (topLevel && (_ref1 = source.slice(-7), __indexOf.call(coffee_exts, _ref1) < 0)) {
if (topLevel && (_ref1 = path.extname(source), __indexOf.call(coffee_exts, _ref1) < 0)) {
source = sources[sources.indexOf(source)] = "" + source + ".coffee";
return compilePath(source, topLevel, base);
}

View File

@@ -88,7 +88,7 @@ compilePath = (source, topLevel, base) ->
fs.stat source, (err, stats) ->
throw err if err and err.code isnt 'ENOENT'
if err?.code is 'ENOENT'
if topLevel and source[-7..] not in coffee_exts
if topLevel and path.extname(source) not in coffee_exts
source = sources[sources.indexOf(source)] = "#{source}.coffee"
return compilePath source, topLevel, base
if topLevel