From 9fb9962ce7043bc3152bb0bee4a7ac17c35592d6 Mon Sep 17 00:00:00 2001 From: Giorgio Previtera Date: Sun, 7 Jul 2019 19:15:11 +0100 Subject: 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 --- main.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index c9959df68..7481e24d6 100644 --- a/main.go +++ b/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) -- cgit v1.2.3