I needed a simple package to compress a folder into a .zip or .tar.gz archive and then I realized to make a command for it was less than a hundred lines so I just bundled it into a binary for distribution. Hope you find it useful as I have! https://github.com/mholt/archiver/releases
Works like:
$ archiver open <input> <destination>
$ archiver make <output> <files...>
You can also use it in your Go programs:
err := archiver.Zip("output.zip", []string{"file.txt", "folder"})
// check err
err = archiver.Unzip("input.zip", "output_folder")
// check err
Supports these formats:
- .zip
- .tar.gz (and .tgz)
- .tar.bz2
- .rar (open only)
Thanks to everyone who has helped with the bugs and questions I had when building it!
Cheers!