Support customizing HISHTORY_PATH for people who want to install hishtory in an alternate location to fix #54

This commit is contained in:
David Dworken
2022-12-16 22:22:57 -08:00
parent 53e97253e5
commit f8b51e49da
8 changed files with 80 additions and 52 deletions

View File

@ -692,9 +692,9 @@ func Update(ctx *context.Context) error {
// Unlink the existing binary so we can overwrite it even though it is still running
if runtime.GOOS == "linux" {
homedir := hctx.GetHome(ctx)
err = syscall.Unlink(path.Join(homedir, data.HISHTORY_PATH, "hishtory"))
err = syscall.Unlink(path.Join(homedir, data.GetHishtoryPath(), "hishtory"))
if err != nil {
return fmt.Errorf("failed to unlink %s for update: %v", path.Join(homedir, data.HISHTORY_PATH, "hishtory"), err)
return fmt.Errorf("failed to unlink %s for update: %v", path.Join(homedir, data.GetHishtoryPath(), "hishtory"), err)
}
}