Skip to content

Commit 3a9dbf7

Browse files
committed
Create temp directories inside a "lazygit" folder rather than top-level in /tmp
This is no longer as important now that we fixed the stale, left-over temp dirs caused by daemon mode, but it could still be helpful in case lazygit crashes, or if you have many instances of lazygit running.
1 parent 6a17144 commit 3a9dbf7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/app/entry_point.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ func Start(buildInfo *BuildInfo, integrationTest integrationTypes.IntegrationTes
124124
os.Exit(0)
125125
}
126126

127-
tempDir, err := os.MkdirTemp("", "lazygit-*")
127+
tmpDirBase := filepath.Join(os.TempDir(), "lazygit")
128+
if err := os.MkdirAll(tmpDirBase, 0o700); err != nil {
129+
log.Fatal(err.Error())
130+
}
131+
tempDir, err := os.MkdirTemp(tmpDirBase, "")
128132
if err != nil {
129133
log.Fatal(err.Error())
130134
}

0 commit comments

Comments
 (0)