[ Agent ] [ App ] - offline build nfs client - 1

This commit is contained in:
zeaslity
2023-12-14 17:11:24 +08:00
parent fb3e109b75
commit 4c7a9aec7b
2 changed files with 39 additions and 48 deletions

View File

@@ -187,6 +187,23 @@ func BasicReplace(filename string, origin string, replace string) bool {
}
}
func BasicRemoveFolderComplete(folderName string) bool {
if !BasicFileExists(folderName) || !BasicFolderExists(folderName) {
log.DebugF("[BasicRemoveFolderComplete] - file or folder of [%s] not exists !", folderName)
return true
}
cmd := exec.Command("rm", "-rf", folderName)
err := cmd.Run()
if err != nil {
log.DebugF("删除 %s 失败!", folderName)
return false
} else {
return true
}
}
// BasicFileExists 检测文件是否存在
func BasicFileExists(filename string) bool {