mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-07 00:17:37 +08:00
fix: 修复download path错误
This commit is contained in:
@@ -47,6 +47,9 @@ func init() {
|
|||||||
if err := builtin.EnsureFolderExists(ResultsPath); err != nil {
|
if err := builtin.EnsureFolderExists(ResultsPath); err != nil {
|
||||||
log.Fatal().Err(err).Msg("create results directory failed")
|
log.Fatal().Err(err).Msg("create results directory failed")
|
||||||
}
|
}
|
||||||
|
if err := builtin.EnsureFolderExists(DownloadsPath); err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("create results directory failed")
|
||||||
|
}
|
||||||
if err := builtin.EnsureFolderExists(ScreenShotsPath); err != nil {
|
if err := builtin.EnsureFolderExists(ScreenShotsPath); err != nil {
|
||||||
log.Fatal().Err(err).Msg("create screenshots directory failed")
|
log.Fatal().Err(err).Msg("create screenshots directory failed")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ func DownloadFileByUrl(fileUrl string) (filePath string, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create the output file.
|
// Create the output file.
|
||||||
outFile, err := os.Create(fileName)
|
outFile, err := os.Create(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@@ -314,6 +314,6 @@ func DownloadFileByUrl(fileUrl string) (filePath string, err error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("File downloaded successfully: %s\n", fileName)
|
fmt.Printf("File downloaded successfully: %s\n", filePath)
|
||||||
return filePath, nil
|
return filePath, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user