mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Using string interpolation when adding extension
This commit is contained in:
@@ -63,7 +63,7 @@
|
||||
compile = function(source, sourceIndex, topLevel) {
|
||||
return path.exists(source, function(exists) {
|
||||
if (topLevel && !exists && source.slice(-7) !== '.coffee') {
|
||||
return compile(source + ".coffee", sourceIndex, topLevel);
|
||||
return compile("" + source + ".coffee", sourceIndex, topLevel);
|
||||
}
|
||||
if (topLevel && !exists) {
|
||||
throw new Error("File not found: " + source);
|
||||
|
||||
@@ -79,7 +79,7 @@ compileScripts = ->
|
||||
compile = (source, sourceIndex, topLevel) ->
|
||||
path.exists source, (exists) ->
|
||||
if topLevel and not exists and source[-7..] isnt '.coffee'
|
||||
return compile source + ".coffee", sourceIndex, topLevel
|
||||
return compile "#{source}.coffee", sourceIndex, topLevel
|
||||
|
||||
throw new Error "File not found: #{source}" if topLevel and not exists
|
||||
fs.stat source, (err, stats) ->
|
||||
|
||||
Reference in New Issue
Block a user