feat: support run testcases in specified folder path #1198

This commit is contained in:
debugtalk
2022-03-28 18:12:51 +08:00
parent 205657588e
commit 1e91b8cb0f
7 changed files with 121 additions and 17 deletions

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)