mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-02 03:56:45 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c08903e3ad | ||
|
|
5a654b1d56 | ||
|
|
525edfbc4d | ||
|
|
71813fdda5 | ||
|
|
bcb95bd211 | ||
|
|
2e0d66ca24 | ||
|
|
5175798cb1 | ||
|
|
84b057c4a1 |
@@ -36,26 +36,3 @@ snapshot:
|
||||
changelog:
|
||||
use: github-native
|
||||
sort: asc
|
||||
brews:
|
||||
-
|
||||
# Repository to push the tap to.
|
||||
repository:
|
||||
owner: jesseduffield
|
||||
name: homebrew-lazygit
|
||||
|
||||
# Your app's homepage.
|
||||
# Default is empty.
|
||||
homepage: 'https://github.com/jesseduffield/lazygit/'
|
||||
|
||||
# Your app's description.
|
||||
# Default is empty.
|
||||
description: 'A simple terminal UI for git commands, written in Go'
|
||||
|
||||
# # Packages your package depends on.
|
||||
# dependencies:
|
||||
# - git
|
||||
# - zsh
|
||||
# # Packages that conflict with your package.
|
||||
# conflicts:
|
||||
# - svn
|
||||
# - bash
|
||||
|
||||
+18
-5
@@ -8,6 +8,7 @@ import (
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"os/exec"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
@@ -124,11 +125,7 @@ func Start(buildInfo *BuildInfo, integrationTest integrationTypes.IntegrationTes
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
tmpDirBase := filepath.Join(os.TempDir(), "lazygit")
|
||||
if err := os.MkdirAll(tmpDirBase, 0o700); err != nil {
|
||||
log.Fatal(err.Error())
|
||||
}
|
||||
tempDir, err := os.MkdirTemp(tmpDirBase, "")
|
||||
tempDir, err := os.MkdirTemp(getTempDirBase(), "lazygit-*")
|
||||
if err != nil {
|
||||
log.Fatal(err.Error())
|
||||
}
|
||||
@@ -314,3 +311,19 @@ func getGitVersionInfo() string {
|
||||
gitVersion := strings.Trim(strings.TrimPrefix(string(stdout), "git version "), " \r\n")
|
||||
return gitVersion
|
||||
}
|
||||
|
||||
func getTempDirBase() string {
|
||||
tempDir := os.TempDir()
|
||||
|
||||
user, err := user.Current()
|
||||
if err != nil || user.Uid == "" {
|
||||
return tempDir
|
||||
}
|
||||
|
||||
tmpDirBase := filepath.Join(tempDir, "lazygit-"+user.Uid)
|
||||
if err := os.MkdirAll(tmpDirBase, 0o700); err != nil {
|
||||
return tempDir
|
||||
}
|
||||
|
||||
return tmpDirBase
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user