Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Updated tar archiver to create directories similar to zip archiver #83

Closed

Conversation

payaaam
Copy link

@payaaam payaaam commented Sep 2, 2018

changes: patch

Bug Fix
I noticed that when I create tar files, the output directory structure has nesting that is not intended. I then tested the zip archiver and saw that this was not an issue. I updated the tar archiver to have same directory parsing logic as zip.

Changes

  • updated path to fpath in filepath.Walk to allow for path package import
  • Updated baseDir handling to match zip

}

if baseDir != "" {
header.Name = filepath.ToSlash(filepath.Join(baseDir, strings.TrimPrefix(path, source)))
name, err := filepath.Rel(source, fpath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance you can add a test for this here, that fails without this diff, and passes with this diff?

@mholt
Copy link
Owner

mholt commented Nov 7, 2018

This might not be an issue anymore with #99. Will probably close this if there's no more activity or unless someone confirms it's still an issue.

@mholt mholt closed this Nov 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants