Show a better error message if the temp directory is not writeable (#4968)

This happened to a few users after updating macOS to version 15.7.1, and
apparently a reboot fixes it, so suggest this in the error message.

Closes #4924
This commit is contained in:
Stefan Haller 2025-10-16 10:10:30 +02:00 committed by GitHub
commit 7282159f78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -125,8 +125,13 @@ func Start(buildInfo *BuildInfo, integrationTest integrationTypes.IntegrationTes
os.Exit(0)
}
tempDir, err := os.MkdirTemp(getTempDirBase(), "lazygit-*")
tempDirBase := getTempDirBase()
tempDir, err := os.MkdirTemp(tempDirBase, "lazygit-*")
if err != nil {
if os.IsPermission(err) {
log.Fatalf("Your temp directory (%s) is not writeable. Try if rebooting your machine fixes this.", tempDirBase)
}
log.Fatal(err.Error())
}
defer os.RemoveAll(tempDir)