mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-07 23:41:22 +08:00
feat: support run testcases in specified folder path #1198
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user