Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
decode uri on createRelativePath
  • Loading branch information
theimowski committed Dec 1, 2014
commit 5a6870a4ac805a2027c0f7c3454528e9cf156809
2 changes: 1 addition & 1 deletion src/Paket.Core/Utils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let CleanDir path =
/// [omit]
let inline createRelativePath root path =
let uri = Uri(if String.IsNullOrEmpty root then System.Environment.CurrentDirectory + Path.DirectorySeparatorChar.ToString() else root)
uri.MakeRelativeUri(Uri(path)).ToString().Replace("/", "\\")
uri.MakeRelativeUri(Uri(path)).ToString().Replace("/", "\\") |> Uri.UnescapeDataString

/// [omit]
let inline normalizeXml(doc:XmlDocument) =
Expand Down
1 change: 1 addition & 0 deletions tests/Paket.Tests/Paket.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<Compile Include="NugetVersionRangeParserSpecs.fs" />
<Compile Include="NugetVersionRangeSerializerSpecs.fs" />
<Compile Include="BindingRedirect.fs" />
<Compile Include="UtilsSpecs.fs" />
<Content Include="Nuspec\FSharp.Data.nuspec">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
9 changes: 9 additions & 0 deletions tests/Paket.Tests/UtilsSpecs.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Paket.UtilsSpecs

open Paket
open NUnit.Framework
open FsUnit

[<Test>]
let ``createRelativePath should handle spaces``() =
"C:/some file" |> createRelativePath "C:/a/b" |> shouldEqual "..\\some file"