1
0

Use single temp directory base

This commit is contained in:
2023-04-07 16:43:56 +00:00
parent 32b692f752
commit 056e38698e
6 changed files with 18 additions and 21 deletions

10
pew.go
View File

@ -14,7 +14,6 @@ import (
"math/rand"
"os"
"os/exec"
"os/user"
"strings"
"time"
@ -599,14 +598,7 @@ func (cmd PewCmd) testArtifact(swg *sizedwaitgroup.SizedWaitGroup,
}
}()
usr, err := user.Current()
if err != nil {
return
}
tmpdir := usr.HomeDir + "/.out-of-tree/tmp"
os.MkdirAll(tmpdir, os.ModePerm)
tmp, err := ioutil.TempDir(tmpdir, "out-of-tree_")
tmp, err := ioutil.TempDir(tempDirBase, "out-of-tree_")
if err != nil {
slog.Error().Err(err).Msg("making tmp directory")
return