Skip to content

Commit

Permalink
Merge pull request #755 from Vidarls/zip
Browse files Browse the repository at this point in the history
Fix for missing content using net4.5 zip
  • Loading branch information
forki committed Apr 8, 2015
2 parents a5fdfde + 594d4e5 commit babc102
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit babc102

Please sign in to comment.