diff --git a/iris/main.go b/iris/main.go index 5e0102cd..67a2f61e 100644 --- a/iris/main.go +++ b/iris/main.go @@ -86,7 +86,7 @@ func downloadPackages() { // we don't exit on errors here. // try to remove the unzipped folder - utils.RemoveFile(installedDir) + utils.RemoveFile(installedDir[0 : len(installedDir)-1]) } func createPackage(packageName string, targetDir string) error { diff --git a/utils/file.go b/utils/file.go index 64b85e07..1cc8faa1 100644 --- a/utils/file.go +++ b/utils/file.go @@ -142,9 +142,9 @@ func Unzip(archive string, target string) (string, error) { return createdFolder, nil } -// RemoveFile removes a file and returns an error, if any +// RemoveFile removes a file or directory and returns an error, if any func RemoveFile(filePath string) error { - return ErrFileRemove.With(os.Remove(filePath)) + return ErrFileRemove.With(os.RemoveAll(filePath)) } // Install is just the flow of: downloadZip -> unzip -> removeFile(zippedFile)