mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-19 12:12:42 +02:00
Don't quit on error
This commit is contained in:
parent
87b2455dbb
commit
894485190b
@ -4,7 +4,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -50,7 +49,8 @@ func (self *WorktreeHelper) GetMainWorktreeName() string {
|
|||||||
func (self *WorktreeHelper) IsCurrentWorktree(w *models.Worktree) bool {
|
func (self *WorktreeHelper) IsCurrentWorktree(w *models.Worktree) bool {
|
||||||
pwd, err := os.Getwd()
|
pwd, err := os.Getwd()
|
||||||
if err != nil {
|
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
|
return pwd == w.Path
|
||||||
@ -61,7 +61,8 @@ func (self *WorktreeHelper) IsWorktreePathMissing(w *models.Worktree) bool {
|
|||||||
if errors.Is(err, fs.ErrNotExist) {
|
if errors.Is(err, fs.ErrNotExist) {
|
||||||
return true
|
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
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user