Fixes #2941 -- don't destroy extensionless filenames for --join

This commit is contained in:
Jeremy Ashkenas 2013-10-20 19:09:55 -03:00
parent 351c875576
commit c22707cd53
3 changed files with 3 additions and 3 deletions

View File

@ -167,7 +167,7 @@
pathSep = useWinPathSep ? /\\|\// : /\//;
parts = file.split(pathSep);
file = parts[parts.length - 1];
if (!stripExt) {
if (!(stripExt && file.indexOf('.') >= 0)) {
return file;
}
parts = file.split('.');

View File

@ -119,7 +119,7 @@ compilePath = (source, topLevel, base) ->
# Compile a single source script, containing the given code, according to the
# requested options. If evaluating the script directly sets `__filename`,
# `__dirname` and `module.filename` to be correct relative to the script's path.
compileScript = (file, input, base=null) ->
compileScript = (file, input, base = null) ->
o = opts
options = compileOptions file, base
try

View File

@ -122,7 +122,7 @@ exports.baseFileName = (file, stripExt = no, useWinPathSep = no) ->
pathSep = if useWinPathSep then /\\|\// else /\//
parts = file.split(pathSep)
file = parts[parts.length - 1]
return file unless stripExt
return file unless stripExt and file.indexOf('.') >= 0
parts = file.split('.')
parts.pop()
parts.pop() if parts[parts.length - 1] is 'coffee' and parts.length > 1