1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 22:33:07 +02:00

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.
This commit is contained in:
Stefan Haller
2025-07-30 11:41:35 +02:00
parent 6a17144ef4
commit 3a9dbf7341

View File

@ -124,7 +124,11 @@ func Start(buildInfo *BuildInfo, integrationTest integrationTypes.IntegrationTes
os.Exit(0) os.Exit(0)
} }
tempDir, err := os.MkdirTemp("", "lazygit-*") tmpDirBase := filepath.Join(os.TempDir(), "lazygit")
if err := os.MkdirAll(tmpDirBase, 0o700); err != nil {
log.Fatal(err.Error())
}
tempDir, err := os.MkdirTemp(tmpDirBase, "")
if err != nil { if err != nil {
log.Fatal(err.Error()) log.Fatal(err.Error())
} }