add user configuration in json file

This commit is contained in:
Jesse Duffield 2018-08-15 21:34:25 +10:00
parent 905e6c16ba
commit 29ed971558
4 changed files with 93 additions and 25 deletions

20
main.go
View file

@ -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()