mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-22 16:24:00 +01:00
Skip reading history files if they don't exist
This commit is contained in:
parent
6093d06110
commit
0b3ccb63a5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user