Skip to content

Commit 5d5db72

Browse files
committed
use os.GetWd instead
1 parent 017c57e commit 5d5db72

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scaletest/dashboard/chromedp.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,10 @@ func Screenshot(ctx context.Context, name string) (string, error) {
243243
return "", xerrors.Errorf("generate random string: %w", err)
244244
}
245245
fname := fmt.Sprintf("scaletest-dashboard-%s-%s-%s.png", name, time.Now().Format("20060102-150405"), randExt)
246-
pwd := os.Getenv("PWD")
246+
pwd, err := os.Getwd()
247+
if err != nil {
248+
return "", xerrors.Errorf("get working directory: %w", err)
249+
}
247250
fpath := filepath.Join(pwd, fname)
248251
f, err := os.OpenFile(fpath, os.O_CREATE|os.O_WRONLY, 0o644)
249252
if err != nil {

0 commit comments

Comments
 (0)