From f672e0cdb5cd5b1d065cdc51fc7c337a7708b4f4 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Mon, 7 Jan 2013 22:35:20 -0600 Subject: [PATCH] fix 'litcoffee' extension support As pointed out by @satyr in 27551b23f3e8b3568b97b823226b89ed9c28802e --- lib/coffee-script/command.js | 2 +- src/command.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/coffee-script/command.js b/lib/coffee-script/command.js index c6bcfe00..dfefacd5 100644 --- a/lib/coffee-script/command.js +++ b/lib/coffee-script/command.js @@ -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); } diff --git a/src/command.coffee b/src/command.coffee index 9464b3ba..25cbd84d 100644 --- a/src/command.coffee +++ b/src/command.coffee @@ -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