mirror of
https://github.com/atom/atom.git
synced 2026-02-10 06:35:00 -05:00
fs.directory does not append a trailing '/' to directories
This commit is contained in:
@@ -38,7 +38,7 @@ class Project
|
||||
fs.absolute filePath
|
||||
|
||||
relativize: (fullPath) ->
|
||||
fullPath.replace(@path, "")
|
||||
fullPath.replace(@path, "").replace(/^\//, '')
|
||||
|
||||
bufferWithId: (id) ->
|
||||
return buffer for buffer in @buffers when buffer.id == id
|
||||
|
||||
@@ -21,7 +21,7 @@ class AddDialog extends View
|
||||
@miniEditor.on 'focusout', => @remove()
|
||||
|
||||
directoryPath = if fs.isFile(@path) then fs.directory(@path) else @path
|
||||
relativePath = @rootView.project.relativize(directoryPath)
|
||||
relativePath = @rootView.project.relativize(directoryPath) + '/'
|
||||
@miniEditor.setText(relativePath)
|
||||
|
||||
confirm: ->
|
||||
|
||||
@@ -22,9 +22,9 @@ module.exports =
|
||||
# non-directory component removed.
|
||||
directory: (path) ->
|
||||
if @isDirectory(path)
|
||||
path.replace(/\/?$/, '/')
|
||||
path.replace(/\/?$/, '')
|
||||
else
|
||||
path.replace(new RegExp("/#{@base(path)}$"), '/')
|
||||
path.replace(new RegExp("/#{@base(path)}$"), '')
|
||||
|
||||
# Returns true if the file specified by path exists
|
||||
exists: (path) ->
|
||||
|
||||
Reference in New Issue
Block a user