Skip reading history files if they don't exist

This commit is contained in:
David Dworken 2022-09-17 12:22:29 -07:00
parent 6093d06110
commit 0b3ccb63a5

View File

@ -529,6 +529,9 @@ func parseBashHistory(homedir string) ([]string, error) {
}
func readFileToArray(path string) ([]string, error) {
if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) {
return []string{}, nil
}
file, err := os.Open(path)
if err != nil {
return nil, err