feat: error/success hooks
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user