feat: error/success hooks

This commit is contained in:
Sam Hoffman
2026-02-07 10:43:08 -05:00
parent 7774a5b956
commit 3c11a79252
4 changed files with 170 additions and 8 deletions

View File

@@ -78,6 +78,31 @@ func ParseSnapshots(reader io.Reader) ([]Snapshot, error) {
return snaps, nil
}
type Host struct {
SSH string
ZFSPath string
}
func (h *Host) CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd {
var args []string
if h.SSH != "" {
name = "ssh"
args = append([]string{"ssh", h.SSH}, arg...)
} else {
args = arg
}
cmd := exec.CommandContext(
ctx,
name,
args...,
)
return cmd
}
// h.Comman
func Snapshots(ctx context.Context, target string) ([]Snapshot, error) {
cmd := exec.CommandContext(
ctx,