Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for missing content using net4.5 zip #755

Merged
merged 1 commit into from
Apr 8, 2015
Merged
Changes from all commits
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
7 changes: 6 additions & 1 deletion src/Paket.Core/NupkgWriter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ let Write (core : CompleteCoreInfo) optional workingDir outputDir =
writerF stream
stream.Close()

let ensureValidTargetName (target:string) =
match target.Replace(" ", "%20") with
| t when t.EndsWith("/") -> t
| t -> t + "/"

// adds all files in a directory to the zipFile
let rec addDir source target =
for file in Directory.EnumerateFiles(source,"*.*",SearchOption.TopDirectoryOnly) do
Expand All @@ -215,7 +220,7 @@ let Write (core : CompleteCoreInfo) optional workingDir outputDir =

// add files
for fileName,targetFileName in optional.Files do
let targetFileName = targetFileName.Replace(" ", "%20")
let targetFileName = ensureValidTargetName targetFileName
let source = Path.Combine(workingDir, fileName)
if Directory.Exists source then
addDir source targetFileName
Expand Down