tests passing inside act, hopefully on real actions

This commit is contained in:
David Dworken
2022-04-13 21:30:27 -07:00
parent 908257306e
commit e2b5fd13bf
4 changed files with 12 additions and 5 deletions

View File

@ -342,6 +342,12 @@ func installBinary(homedir string) (string, error) {
if err != nil {
clientPath = path.Join(homedir, shared.HISHTORY_PATH, "hishtory")
}
if _, err := os.Stat(clientPath); err == nil {
err = syscall.Unlink(clientPath)
if err != nil {
return "", fmt.Errorf("failed to unlink %s for install: %v", clientPath, err)
}
}
err = copyFile(os.Args[0], clientPath)
if err != nil {
return "", fmt.Errorf("failed to copy hishtory binary to $PATH: %v", err)
@ -394,7 +400,7 @@ func Update(url string) error {
}
err = syscall.Unlink(path.Join(homedir, shared.HISHTORY_PATH, "hishtory"))
if err != nil {
return fmt.Errorf("failed to unlink %s: %v", path.Join(homedir, shared.HISHTORY_PATH, "hishtory"), err)
return fmt.Errorf("failed to unlink %s for update: %v", path.Join(homedir, shared.HISHTORY_PATH, "hishtory"), err)
}
// TODO: Check the SLSA attestation before installing
cmd = exec.Command("/tmp/hishtory-client", "install")