mirror of
https://github.com/ddworken/hishtory.git
synced 2025-03-28 16:46:27 +01:00
Fix bug introduced in c00e5d where hishtory import would fail if shell history files didn't exist (e.g. because the user had never used zsh)
This commit is contained in:
parent
c21d443fa6
commit
e3c70beb6b
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user