Fix bug in Project::relativize

This commit is contained in:
Max Brunsfeld
2015-02-18 16:47:21 -08:00
parent d35b99285e
commit a9adfa6a76
2 changed files with 8 additions and 2 deletions

View File

@@ -241,8 +241,8 @@ class Project extends Model
relativize: (fullPath) ->
return fullPath if fullPath?.match(/[A-Za-z0-9+-.]+:\/\//) # leave path alone if it has a scheme
for rootDirectory in @rootDirectories
if (relativePath = rootDirectory.relativize(fullPath))?
return relativePath
relativePath = rootDirectory.relativize(fullPath)
return relativePath if relativePath isnt fullPath
fullPath
# Public: Determines whether the given path (real or symbolic) is inside the