Skip to content

Commit

Permalink
shared: Clean up tarball if tar fails
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
  • Loading branch information
monstermunchkin committed Mar 14, 2018
1 parent 61ef5b0 commit a05c374
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions shared/util.go
Expand Up @@ -143,6 +143,8 @@ func CreateGPGKeyring(keyserver string, keys []string) (string, error) {
func Pack(filename, compression, path string, args ...string) error {
err := RunCommand("tar", append([]string{"-cf", filename, "-C", path}, args...)...)
if err != nil {
// Clean up incomplete tarball
os.Remove(filename)
return err
}

Expand Down

0 comments on commit a05c374

Please sign in to comment.