Skip to content

Commit

Permalink
Fix bug introduced in c00e5d where hishtory import would fail if shel…
Browse files Browse the repository at this point in the history
…l history files didn't exist (e.g. because the user had never used zsh)
  • Loading branch information
ddworken committed Sep 24, 2023
1 parent c21d443 commit e3c70be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/lib/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func Values[Slice ~[]Elem, Elem any](s Slice) Seq2[Elem, error] {
func readFileToIterator(path string) Seq2[string, error] {
return func(yield func(string, error) bool) bool {
if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) {
return yield("", fmt.Errorf("file does not exist: %w", err))
return true
}
file, err := os.Open(path)
if err != nil {
Expand Down

0 comments on commit e3c70be

Please sign in to comment.