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

Enhance FilesFromDisk (close #331) #332

Merged
merged 2 commits into from
Apr 15, 2022
Merged

Enhance FilesFromDisk (close #331) #332

merged 2 commits into from
Apr 15, 2022

Conversation

mholt
Copy link
Owner

@mholt mholt commented Apr 14, 2022

Now permit suffixing root on disk with separator to enumerate only
its contents and not to create that actual file in archive.

And attempt improving Windows compatibility. I don't have Windows handy so this'll have to be CI-based feedback.

@nicola-spb could you give this a try?

Now permit suffixing root on disk with separator to enumerate only
its contents and not to create that actual file in archive.

And attempt improving Windows compatibility.
@nicola-spb
Copy link

@mholt I am working in Linux too :(

@mholt
Copy link
Owner Author

mholt commented Apr 14, 2022

That's fine, I mostly want you to test the feature you requested.

@nicola-spb
Copy link

nicola-spb commented Apr 14, 2022

Yes it's work on Ubuntu.

Tested it:

files, err := archiver.FilesFromDisk(nil, map[string]string{
	"/path/on/disk/folder/": "",  // adding files to root in archive
})
files, err := archiver.FilesFromDisk(nil, map[string]string{
	"/path/on/disk/folder": "",  // adding files to "folder" in archive
})

@mholt
Copy link
Owner Author

mholt commented Apr 14, 2022

Perfect, thanks for verifying it does what you need!

I'll clean up the implementation and get them working on Windows. I might also work on the dot (.) situation but how complex it is depends whether it goes in this PR.

@mholt mholt merged commit f7aa48e into master Apr 15, 2022
@mholt mholt deleted the windows branch April 15, 2022 02:12
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.

2 participants