mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-19 19:37:59 +02:00
Respect HISTFILE for bash history too
This commit is contained in:
parent
ed3c67daf9
commit
6ded150f4a
@ -622,7 +622,11 @@ func parseFishHistory(homedir string) ([]string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func parseBashHistory(homedir string) ([]string, error) {
|
func parseBashHistory(homedir string) ([]string, error) {
|
||||||
return readFileToArray(filepath.Join(homedir, ".bash_history"))
|
histfile := os.Getenv("HISTFILE")
|
||||||
|
if histfile == "" {
|
||||||
|
histfile = filepath.Join(homedir, ".bash_history")
|
||||||
|
}
|
||||||
|
return readFileToArray(histfile)
|
||||||
}
|
}
|
||||||
|
|
||||||
func readFileToArray(path string) ([]string, error) {
|
func readFileToArray(path string) ([]string, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user