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

fix 'litcoffee' extension support

As pointed out by @satyr in 27551b23f3
This commit is contained in:
Michael Ficarra 2013-01-07 22:35:20 -06:00
parent 66bbef4ce0
commit f672e0cdb5
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