mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-26 23:12:09 +02: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) {
|
func readFileToArray(path string) ([]string, error) {
|
||||||
|
if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) {
|
||||||
|
return []string{}, nil
|
||||||
|
}
|
||||||
file, err := os.Open(path)
|
file, err := os.Open(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user