mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-09 07:05:08 +02:00
Avoid constantly copying the binary back and forth to make tests faster on github actions
This commit is contained in:
@ -78,7 +78,6 @@ func BackupAndRestoreWithId(t testing.TB, id string) func() {
|
||||
path.Join(homedir, data.GetHishtoryPath(), DB_WAL_PATH),
|
||||
path.Join(homedir, data.GetHishtoryPath(), DB_SHM_PATH),
|
||||
path.Join(homedir, data.GetHishtoryPath(), data.CONFIG_PATH),
|
||||
path.Join(homedir, data.GetHishtoryPath(), "hishtory"),
|
||||
path.Join(homedir, data.GetHishtoryPath(), "config.sh"),
|
||||
path.Join(homedir, data.GetHishtoryPath(), "config.zsh"),
|
||||
path.Join(homedir, data.GetHishtoryPath(), "config.fish"),
|
||||
@ -86,6 +85,13 @@ func BackupAndRestoreWithId(t testing.TB, id string) func() {
|
||||
path.Join(homedir, ".zsh_history"),
|
||||
path.Join(homedir, ".local/share/fish/fish_history"),
|
||||
}
|
||||
hishtoryBinaryPath := path.Join(homedir, data.GetHishtoryPath(), "hishtory")
|
||||
if IsGithubAction() {
|
||||
// On github actions, avoid constantly copying the binary back and forth since we aren't worried about an existing hishtory installation
|
||||
_ = os.Remove(hishtoryBinaryPath)
|
||||
} else {
|
||||
renameFiles = append(renameFiles, hishtoryBinaryPath)
|
||||
}
|
||||
for _, file := range renameFiles {
|
||||
touchFile(file)
|
||||
Check(t, rename(file, getBackPath(file, id)))
|
||||
|
Reference in New Issue
Block a user