diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-03-02 20:32:16 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-03-02 21:31:48 +1100 |
commit | ab81f27fc792bccd630189f0f08721d1d1231f54 (patch) | |
tree | 5e672f4461ef560b0d74237206bd46293ba8f7c3 /pkg/app | |
parent | dbb01b028deab71b3f4a3f5f5f251a0b56d5c9d6 (diff) |
don't show stack trace if lazygit is started outside of a git repo
Diffstat (limited to 'pkg/app')
-rw-r--r-- | pkg/app/app.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/app/app.go b/pkg/app/app.go index 23bd661cf..a8d0a1045 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -1,6 +1,7 @@ package app import ( + "fmt" "io" "io/ioutil" "os" @@ -104,6 +105,10 @@ func NewApp(config config.AppConfigurer) (*App, error) { } app.GitCommand, err = commands.NewGitCommand(app.Log, app.OSCommand, app.Tr, app.Config) if err != nil { + if strings.Contains(err.Error(), "Not a git repository") { + fmt.Println("Not in a git repository. Use `git init` to create a new one") + os.Exit(1) + } return app, err } app.Gui, err = gui.NewGui(app.Log, app.GitCommand, app.OSCommand, app.Tr, config, app.Updater) |