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

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants