Skip to content

Commit 03a3054

Browse files
committed
Use TMPDIR as runtime dir on macOs
Signed-off-by: German Maglione <[email protected]>
1 parent 19cb4a0 commit 03a3054

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/user/user.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"os"
66
"os/user"
77
"path/filepath"
8+
"runtime"
89
"strconv"
910

1011
"github.com/containers/podman-bootc/pkg/config"
@@ -57,6 +58,15 @@ func (u *User) DefaultIdentity() string {
5758
}
5859

5960
func (u *User) RunDir() string {
61+
if runtime.GOOS == "darwin" {
62+
tmpDir, ok := os.LookupEnv("TMPDIR")
63+
if !ok {
64+
tmpDir = "/tmp"
65+
}
66+
67+
return filepath.Join(tmpDir, config.ProjectName, "run")
68+
}
69+
6070
return filepath.Join(xdg.RuntimeDir, config.ProjectName, "run")
6171
}
6272

0 commit comments

Comments
 (0)