mirror of
https://github.com/atom/atom.git
synced 2026-02-03 19:25:06 -05:00
Escape ext in RegExp from fs.base
This commit is contained in:
@@ -15,7 +15,7 @@ module.exports =
|
||||
# remove a trailing extension.
|
||||
base: (path, ext) ->
|
||||
base = path.replace(/\/$/, '').split("/").pop()
|
||||
if ext then base.replace(RegExp(ext + "$"), "") else base
|
||||
if ext then base.replace(RegExp("#{_.escapeRegExp(ext)}$"), '') else base
|
||||
|
||||
# Returns the path of a file's containing directory, albeit the
|
||||
# parent directory if the file is a directory. A terminal directory
|
||||
|
||||
Reference in New Issue
Block a user