Skip to content

Commit

Permalink
Zip: Fixed bug with relative paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
patriksvensson committed Jun 27, 2014
1 parent 5063af4 commit 9208346
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Cake.Common/IO/Zipper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ public void Zip(DirectoryPath rootPath, FilePath outputPath, IEnumerable<FilePat
using (var archive = new ZipArchive(outputStream, ZipArchiveMode.Create))
{
foreach (var inputPath in filePaths)
{
var file = _fileSystem.GetFile(inputPath.MakeAbsolute(_environment));
{
var absoluteInputPath = inputPath.MakeAbsolute(_environment);
var file = _fileSystem.GetFile(absoluteInputPath);
using (var inputStream = file.Open(FileMode.Open, FileAccess.Read, FileShare.Read))
{
// Get the relative filename to the rootPath.
var relativeFilePath = GetRelativeFilePath(rootPath, inputPath);
var relativeFilePath = GetRelativeFilePath(rootPath, absoluteInputPath);
_log.Verbose("Adding file: {0}", relativeFilePath);

// Create the zip archive entry.
Expand Down

0 comments on commit 9208346

Please sign in to comment.