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

support excluding directories #16

Closed
jackytck opened this issue Nov 30, 2016 · 4 comments
Closed

support excluding directories #16

jackytck opened this issue Nov 30, 2016 · 4 comments

Comments

@jackytck
Copy link

I'd like to make a PR to exclude certain directories when archiving.

So we just need to pass down a slice of excluded paths to filepath.Walk, then return filepath.SkipDir if the path matches any of the excluded path?

What do you think?

@mholt
Copy link
Owner

mholt commented Nov 30, 2016

Sure this is easy, but the purpose of archiver is to mimic your OS's file explorer's "right-click and click Compress" functionality, and I really like the simplicity of its API as-is. Can this be done without changing the function signatures or simple usage?

@jackytck
Copy link
Author

jackytck commented Dec 1, 2016

I also like the simplicity. And I don't want to pollute that. Seems that there's no way of passing additional options without changing Make(destination string, sources []string) error. Making a new function e.g. sth like MakeAdvance(), is not very elegant to me. So I just fallback to use tar, anyway. Thanks.

@mholt
Copy link
Owner

mholt commented Dec 1, 2016

Okay. Sorry about that. I'd rather keep the scope of this project narrow. I invite others to create other applications that build on it if they wish!

@mholt mholt closed this as completed Dec 1, 2016
@mholt
Copy link
Owner

mholt commented Nov 6, 2018

Should be possible now after #99 is in. Each archiver will have a configuration struct that could potentially be used to exclude files.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants