mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-10 20:05:50 +02:00
add user configuration in json file
This commit is contained in:
parent
905e6c16ba
commit
29ed971558
4 changed files with 93 additions and 25 deletions
20
main.go
20
main.go
|
@ -4,9 +4,7 @@ import (
|
|||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/jesseduffield/lazygit/pkg/app"
|
||||
|
@ -22,14 +20,6 @@ var (
|
|||
versionFlag = flag.Bool("v", false, "Print the current version")
|
||||
)
|
||||
|
||||
func homeDirectory() string {
|
||||
usr, err := user.Current()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
return usr.HomeDir
|
||||
}
|
||||
|
||||
func projectPath(path string) string {
|
||||
gopath := os.Getenv("GOPATH")
|
||||
return filepath.FromSlash(gopath + "/src/github.com/jesseduffield/lazygit/" + path)
|
||||
|
@ -56,13 +46,11 @@ func main() {
|
|||
fmt.Printf("commit=%s, build date=%s, version=%s\n", commit, date, version)
|
||||
os.Exit(0)
|
||||
}
|
||||
appConfig := &config.AppConfig{
|
||||
Name: "lazygit",
|
||||
Version: version,
|
||||
Commit: commit,
|
||||
BuildDate: date,
|
||||
Debug: *debuggingFlag,
|
||||
appConfig, err := config.NewAppConfig("lazygit", version, commit, date, debuggingFlag)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
app, err := app.NewApp(appConfig)
|
||||
app.Log.Info(err)
|
||||
app.GitCommand.SetupGit()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue