mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
472 - Don't panic if not in a repository
Display a friendly message and exit with an error if not in a Git repository. Using the same approach used in this PR: https://github.com/jesseduffield/lazydocker/pull/14/files
This commit is contained in:
parent
25c93c678d
commit
9fb9962ce7
5 changed files with 38 additions and 1 deletions
3
main.go
3
main.go
|
@ -52,6 +52,9 @@ func main() {
|
|||
}
|
||||
|
||||
if err != nil {
|
||||
if errorMessage, known := app.KnownError(err); known {
|
||||
log.Fatal(errorMessage)
|
||||
}
|
||||
newErr := errors.Wrap(err, 0)
|
||||
stackTrace := newErr.ErrorStack()
|
||||
app.Log.Error(stackTrace)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue