summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-15 21:34:25 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-15 22:06:37 +1000
commit29ed9715580e991eb8c2c508cbf58910d544be6d (patch)
treeda61a8d762980aa75430da251725ede9a7cb4233 /main.go
parent905e6c16ba6e6fbfbd01338538f730b93504303e (diff)
add user configuration in json file
Diffstat (limited to 'main.go')
-rw-r--r--main.go20
1 files changed, 4 insertions, 16 deletions
diff --git a/main.go b/main.go
index c7fec1ae1..85e0f36bb 100644
--- a/main.go
+++ b/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()