From fc0c6951d7ac36dd8f30ace929991197dc99ae54 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Aug 2026 23:22:25 -0500 Subject: Simplify: centralize paths in layout, dedup zfs snapshot refs, remove dead code - Add layout.Config methods (ReleasesDir, PostReceiveHookPath, RCScriptPath, RCConfPath) so main.go and jailmgr no longer hand-build paths that layout already owns. - Extract zfsutil.snapRef to replace three inline dataset@tag Sprintfs. - Remove seven unused exported functions (zfsutil.Exists, jailmgr.Stop, sh.RunWithStdinFile, and four dead layout.Config path methods) and their now-unused imports. --- cmd/skiff/main.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'cmd/skiff/main.go') diff --git a/cmd/skiff/main.go b/cmd/skiff/main.go index e709227..33aaf5e 100644 --- a/cmd/skiff/main.go +++ b/cmd/skiff/main.go @@ -7,7 +7,6 @@ import ( "flag" "fmt" "os" - "path/filepath" "strings" "skiff/internal/appmeta" @@ -90,7 +89,7 @@ func cmdNewApp(args []string) error { return fmt.Errorf("clone base dataset: %w", err) } - if err := os.MkdirAll(filepath.Join(cfg.AppDir(*name), "releases"), 0755); err != nil { + if err := os.MkdirAll(cfg.ReleasesDir(*name), 0755); err != nil { return fmt.Errorf("create app dir: %w", err) } @@ -115,8 +114,7 @@ func cmdNewApp(args []string) error { if err != nil { return err } - hookPath := filepath.Join(cfg.RepoPath(*name), "hooks", "post-receive") - if err := os.WriteFile(hookPath, []byte(hook), 0755); err != nil { + if err := os.WriteFile(cfg.PostReceiveHookPath(*name), []byte(hook), 0755); err != nil { return fmt.Errorf("install post-receive hook: %w", err) } -- cgit v1.3