feat: support run testcases in specified folder path #1198

This commit is contained in:
debugtalk
2022-03-28 18:44:16 +08:00
parent e31f23cbe0
commit f84bf3b1a6
7 changed files with 121 additions and 17 deletions
+12
View File
@@ -132,6 +132,18 @@ func IsFilePathExists(path string) bool {
return true
}
// IsFolderPathExists returns true if path exists and path is folder
func IsFolderPathExists(path string) bool {
info, err := os.Stat(path)
if err != nil {
// path not exists
return false
}
// path exists and is dir
return info.IsDir()
}
func EnsureFolderExists(folderPath string) error {
if !IsPathExists(folderPath) {
err := CreateFolder(folderPath)