1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-13 11:50:28 +02:00

Don't quit on error

This commit is contained in:
Jesse Duffield 2023-07-17 09:13:16 +10:00
parent 87b2455dbb
commit 894485190b

View File

@ -4,7 +4,6 @@ import (
"errors"
"fmt"
"io/fs"
"log"
"os"
"strings"
@ -50,7 +49,8 @@ func (self *WorktreeHelper) GetMainWorktreeName() string {
func (self *WorktreeHelper) IsCurrentWorktree(w *models.Worktree) bool {
pwd, err := os.Getwd()
if err != nil {
log.Fatalln(err.Error())
self.c.Log.Errorf("failed to obtain current working directory: %w", err)
return false
}
return pwd == w.Path
@ -61,7 +61,8 @@ func (self *WorktreeHelper) IsWorktreePathMissing(w *models.Worktree) bool {
if errors.Is(err, fs.ErrNotExist) {
return true
}
log.Fatalln(fmt.Errorf("failed to check if worktree path `%s` exists\n%w", w.Path, err).Error())
self.c.Log.Errorf("failed to check if worktree path `%s` exists: %w", w.Path, err)
return false
}
return false
}