Skip to content

Commit

Permalink
Fixes trailing slash issue reported in Paket
Browse files Browse the repository at this point in the history
  • Loading branch information
colinbull committed Mar 12, 2015
1 parent 07597cf commit e3eb041
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/app/FakeLib/Globbing/Globbing.fs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ let rec private buildPaths acc (input : SearchOption list) =
Seq.collect (fun dir -> Directory.EnumerateDirectories(dir, "*", SearchOption.AllDirectories)) acc
|> Seq.toList
buildPaths (acc @ dirs) t
| FilePattern(pattern) :: t -> Seq.collect (fun dir -> Directory.EnumerateFiles(dir, pattern)) acc |> Seq.toList
| FilePattern(pattern) :: t ->
Seq.collect (fun dir ->
if Directory.Exists(Path.Combine(dir, pattern))
then seq { yield Path.Combine(dir, pattern) }
else Directory.EnumerateFiles(dir, pattern)) acc |> Seq.toList

let private isDrive =
let regex = Regex(@"^[A-Za-z]:$", RegexOptions.Compiled)
Expand All @@ -65,11 +69,6 @@ let internal search (baseDir : string) (input : string) =
let input = normalizePath input
let input = input.Replace(baseDir, "")

// let input =
// if not (input.EndsWith("/") && DirectoryInfo(Path.Combine(baseDir, input)).Exists) then input + "/"
// else input
//
//
let filePattern = Path.GetFileName(input)
input.Split([| '/'; '\\' |], StringSplitOptions.RemoveEmptyEntries)
|> Seq.map (function
Expand Down

0 comments on commit e3eb041

Please sign in to comment.