mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-27 23:08:02 +02:00
don't show stack trace if lazygit is started outside of a git repo
This commit is contained in:
parent
dbb01b028d
commit
ab81f27fc7
@ -1,6 +1,7 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"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)
|
app.GitCommand, err = commands.NewGitCommand(app.Log, app.OSCommand, app.Tr, app.Config)
|
||||||
if err != nil {
|
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
|
return app, err
|
||||||
}
|
}
|
||||||
app.Gui, err = gui.NewGui(app.Log, app.GitCommand, app.OSCommand, app.Tr, config, app.Updater)
|
app.Gui, err = gui.NewGui(app.Log, app.GitCommand, app.OSCommand, app.Tr, config, app.Updater)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user