[ Agent ] [ App ] - offline build nfs client - 1
This commit is contained in:
@@ -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 {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user