shared: Add Pack function

Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
This commit is contained in:
Thomas Hipp 2018-02-12 16:19:29 +01:00
parent f6958ee378
commit 487633143d
No known key found for this signature in database
GPG Key ID: 993408D1137B7D51

View File

@ -84,3 +84,8 @@ func VerifyFile(signedFile, signatureFile string, keys []string, keyserver strin
return true, nil
}
// Pack creates an xz-compressed tarball.
func Pack(filename, path string, args ...string) error {
return RunCommand("tar", append([]string{"-cJf", filename, "-C", path}, args...)...)
}