Add `--store-symlinks` flag to the `compress` command
Currently, when compressing, ouch always follows symlinks when building an archive, ignoring errors when they occur, meaning there is no way to store a symlink inside of an archive.
The -s/--store-symlinks (possibly with an --symlink alias), would not follow symlinks, but store them directly into the archives (.tar and .zip support this kind of opertation).
Also in case of broken links, it should fail and thrown an error, instead of ignoring them.
(Continuation of the discussion of #224)
the zip library we are using currently doesn't support symlinks (implementation is in progress, see https://github.com/zip-rs/zip/issues/77)
also i think broken symlinks should be kept with --store-symlinks, perhaps with warnings
Thanks for the update, yeah I agree, warnings are more than enough.
The zip library was updated 4 days ago, and added the function add_symlink to ZipWriter:
https://docs.rs/zip/latest/zip/write/struct.ZipWriter.html#method.add_symlink
Do we need to validate if all symlinks point to a file inside of the archive that is being built?
Didn't know zip got an update, good to know!
I think we could throw a warning for broken links and output a different info message for all symlinks, I don't know if we should treat files that point to outside of the archive