summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorClaude <noreply@anthropic.com>2026-08-05 23:22:25 -0500
committerClaude <noreply@anthropic.com>2026-08-05 23:22:25 -0500
commitfc0c6951d7ac36dd8f30ace929991197dc99ae54 (patch)
tree46fa11cc103ebe7805bf42bc3e4bb105e6b49721 /cmd
parent9f7c9f2f31acd7bc544dd988af1c8c2fe63ec504 (diff)
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.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/skiff/main.go6
1 files changed, 2 insertions, 4 deletions
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)
}