From 19923dea5f882036d124cd36a6b7be8a0bab8d76 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Mon, 20 Jun 2016 09:01:41 +0200 Subject: [PATCH] Create folder if needed during package extraction - fixes #1741 --- RELEASE_NOTES.md | 3 +++ src/Paket.Core/NuGetV2.fs | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7c05772386..1cc7aad36c 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 3.1.7 - 20.06.2016 +* BUGFIX: Create folder if needed during package extraction - https://github.com/fsprojects/Paket/issues/1741 + #### 3.1.6 - 19.06.2016 * BUGFIX: Simplify works with auto-detected target frameworks - https://github.com/fsprojects/Paket/pull/1740 diff --git a/src/Paket.Core/NuGetV2.fs b/src/Paket.Core/NuGetV2.fs index c85e1b753b..7b2898c9e1 100644 --- a/src/Paket.Core/NuGetV2.fs +++ b/src/Paket.Core/NuGetV2.fs @@ -375,9 +375,14 @@ let rec private cleanup (dir : DirectoryInfo) = else cleanup sub for file in dir.GetFiles() do + let newName = Uri.UnescapeDataString(file.Name) - if file.Name <> newName && not (File.Exists <| Path.Combine(file.DirectoryName, newName)) then - File.Move(file.FullName, Path.Combine(file.DirectoryName, newName)) + let newFullName = Path.Combine(file.DirectoryName, newName) + if file.Name <> newName && not (File.Exists newFullName) then + if not file.Directory.Exists then + file.Directory.Create() + + File.Move(file.FullName, newFullName) /// Extracts the given package to the user folder