diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-15 21:34:25 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-15 22:06:37 +1000 |
commit | 29ed9715580e991eb8c2c508cbf58910d544be6d (patch) | |
tree | da61a8d762980aa75430da251725ede9a7cb4233 /main.go | |
parent | 905e6c16ba6e6fbfbd01338538f730b93504303e (diff) |
add user configuration in json file
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 20 |
1 files changed, 4 insertions, 16 deletions
@@ -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() |