Skip to content

Commit

Permalink
add lzop/zlma/lzip/zstd unpack compress options.
Browse files Browse the repository at this point in the history
  • Loading branch information
rektide committed Feb 22, 2022
1 parent 91e86fb commit 49a5891
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion actions/unpack_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The default value is 'artifacts' directory in case if this property is omitted.
- compression -- optional hint for unpack allowing to use proper compression method.
Currently only 'gz', bzip2' and 'xz' compression types are supported.
Currently 'gz', bzip2', 'xz', "zstd", "lzop", "lzma", "lzip" compression types are supported.
If not provided an attempt to autodetect the compression type will be done.
*/
package actions
Expand Down
10 changes: 7 additions & 3 deletions archiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ func unpack(command []string, destination string) error {
// Returns empty string for unknown
func tarOptions(compression string) string {
unpackTarOpts := map[string]string{
"gz": "-z",
"bzip2": "-j",
"xz": "-J",
"bzip2": "--bzip2",
"gz": "--gzip",
"lzop": "--lzop",
"lzma": "--lzma",
"lzip", "--lzip",
"xz": "--xz",
"zstd": "--zstd",
} // Trying to guess all other supported compression types

return unpackTarOpts[compression]
Expand Down

0 comments on commit 49a5891

Please sign in to comment.