Skip to content

Commit fd04162

Browse files
committed
make sure it works with exsiting sepchar at the end.
1 parent 3debf9b commit fd04162

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/app/Fake.IO.FileSystem/Globbing.fs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ let internal getRoot (baseDirectory : string) (pattern : string) =
100100
let internal search (baseDir : string) (input : string) =
101101
let baseDir = normalizePath baseDir
102102
let input = normalizePath input
103-
let input = input.Replace(baseDir + string Path.DirectorySeparatorChar, "")
103+
let input =
104+
if String.IsNullOrEmpty baseDir
105+
then input
106+
else input.Replace(baseDir.TrimEnd([|Path.DirectorySeparatorChar|]) + string Path.DirectorySeparatorChar, "")
104107

105108
let filePattern = Path.GetFileName(input)
106109

0 commit comments

Comments
 (0)