mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
utils.file replace os.Remove with os.RemoveAll
This commit is contained in:
parent
8fd5830e2c
commit
d99c15592e
|
@ -86,7 +86,7 @@ func downloadPackages() {
|
||||||
// we don't exit on errors here.
|
// we don't exit on errors here.
|
||||||
|
|
||||||
// try to remove the unzipped folder
|
// try to remove the unzipped folder
|
||||||
utils.RemoveFile(installedDir)
|
utils.RemoveFile(installedDir[0 : len(installedDir)-1])
|
||||||
}
|
}
|
||||||
|
|
||||||
func createPackage(packageName string, targetDir string) error {
|
func createPackage(packageName string, targetDir string) error {
|
||||||
|
|
|
@ -142,9 +142,9 @@ func Unzip(archive string, target string) (string, error) {
|
||||||
return createdFolder, nil
|
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 {
|
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)
|
// Install is just the flow of: downloadZip -> unzip -> removeFile(zippedFile)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user