Skip to content

Commit b2af74d

Browse files
committed
Merge pull request #1644 from matthid/fix_travis_by_fixing_a_bug
Fix failing test case.
2 parents dfe2ff2 + b39b09f commit b2af74d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Paket.Core/ProjectFile.fs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,8 @@ module ProjectFile =
485485
let libReferenceNode =
486486
let name =
487487
match fileItem.BuildAction with
488-
| BuildAction.Reference ->
489-
let n = FileInfo(fileItem.Include).Name.TrimEnd('\\').Split('\\') |> Array.last
490-
n.Replace(Path.GetExtension n,"")
488+
| BuildAction.Reference ->
489+
fileItem.Include |> normalizePath |> Path.GetFileNameWithoutExtension
491490
| _ -> fileItem.Include
492491

493492
createNode (string fileItem.BuildAction) project
@@ -520,7 +519,7 @@ module ProjectFile =
520519
|> getDescendants (string fileItem.BuildAction)
521520
|> List.filter (fun node ->
522521
match node |> getAttribute "Include" with
523-
| Some path when path.StartsWith (Path.GetDirectoryName fileItem.Include) -> true
522+
| Some path when path.StartsWith (fileItem.Include |> normalizePath |> Path.GetDirectoryName |> windowsPath) -> true
524523
| _ -> false)
525524

526525

src/Paket.Core/Utils.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ let askYesNo question =
442442
getAnswer()
443443

444444
let inline normalizePath(path:string) = path.Replace("\\",Path.DirectorySeparatorChar.ToString()).Replace("/",Path.DirectorySeparatorChar.ToString()).TrimEnd(Path.DirectorySeparatorChar)
445-
445+
let inline windowsPath (path:string) = path.Replace(Path.DirectorySeparatorChar, '\\')
446446
/// Gets all files with the given pattern
447447
let inline FindAllFiles(folder, pattern) = DirectoryInfo(folder).GetFiles(pattern, SearchOption.AllDirectories)
448448

0 commit comments

Comments
 (0)