You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
I've implemented a way to support exclusions (which is outside the scope of this library), but it only works if I have complete control over the sources I provide. Here is an example below:
Note: I've already tried add the directory to the sources like this []string{"tmp/client-dir/README", "tmp/client-dir/src", "tmp/client-dir/src/index.html"} but because it's adding files recursively, I end up with duplicated files (I still get files from the nested directory on the root).
Also, this wouldn't work for my use case because I want to have filtered the files before creating the archive. Directories being added recursively defeats this purpose.
I think that is one of two things. What I would like to ascertain first is:
If my sources look like this sources := []string{"foo/bar/index.html"} should I not end up with this in my archive?
foo
└── bar
└── index.html
If that's true then we need to make sure that the directories in the path (foo and bar) get reproduced on in the archive somehow.
// Archive adds all the files or folders in sources// to an archive to be created at destination. Files// are added to the root of the archive, and directories// are walked and recursively added, preserving folder// structure.Archive(sources []string, destinationstring) error
If you want to preserve folder structure, specify the top-level folder you want to include.
I've implemented a way to support exclusions (which is outside the scope of this library), but it only works if I have complete control over the sources I provide. Here is an example below:
I'm expecting the structure to look like this:
Instead, I am getting:
Note: I've already tried add the directory to the sources like this
[]string{"tmp/client-dir/README", "tmp/client-dir/src", "tmp/client-dir/src/index.html"}
but because it's adding files recursively, I end up with duplicated files (I still get files from the nested directory on the root).Also, this wouldn't work for my use case because I want to have filtered the files before creating the archive. Directories being added recursively defeats this purpose.
Related to #16, but not a feature request.
The text was updated successfully, but these errors were encountered: