refactor: results dir

This commit is contained in:
debugtalk
2022-12-16 00:24:35 +08:00
parent ee68b954fb
commit 455724dd1b
12 changed files with 24 additions and 26 deletions
+8 -2
View File
@@ -3,6 +3,7 @@ package env
import (
"os"
"path/filepath"
"time"
)
var (
@@ -19,13 +20,17 @@ var (
)
const (
ResultsDir = "results"
ResultsDirName = "results"
ScreenshotsDirName = "screenshots"
)
var (
RootDir string
ResultsDir string
ResultsPath string
ScreenShotsPath string
StartTime = time.Now()
StartTimeStr = StartTime.Format("20060102150405")
)
func init() {
@@ -35,6 +40,7 @@ func init() {
panic(err)
}
ResultsDir = filepath.Join(ResultsDirName, StartTimeStr)
ResultsPath = filepath.Join(RootDir, ResultsDir)
ScreenShotsPath = filepath.Join(ResultsPath, "screenshots")
ScreenShotsPath = filepath.Join(ResultsPath, ScreenshotsDirName)
}