aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-01-21 05:18:08 +0900
committerOphestra <cat@gensokyo.uk>2026-01-21 05:18:08 +0900
commitf06d7fd387d5b3b3e03f1795e5e3538067462419 (patch)
treeaa75718cb209192195b5881b45fbea36c9d40310 /cmd
parentba75587132d379932362bf86a73811608f810f33 (diff)
cmd/mbf: expose some artifacts for curing
This will remain until dist is successfully bootstrapped. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mbf/main.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go
index 7a0a78e7..d80d0a7b 100644
--- a/cmd/mbf/main.go
+++ b/cmd/mbf/main.go
@@ -136,6 +136,37 @@ func main() {
},
)
+ c.NewCommand(
+ "cure",
+ "Cure the named artifact and show its path",
+ func(args []string) error {
+ if len(args) != 1 {
+ return errors.New("cure requires 1 argument")
+ }
+ var a pkg.Artifact
+ switch args[0] {
+ case "busybox":
+ a = rosa.Std.NewBusybox()
+ case "musl":
+ a = rosa.Std.NewMusl(nil)
+ case "go":
+ a = rosa.Std.NewGo()
+ case "rsync":
+ a = rosa.Std.NewRsync()
+
+ default:
+ return fmt.Errorf("unsupported artifact %q", args[0])
+ }
+
+ pathname, _, err := cache.Cure(a)
+ if err == nil {
+ log.Println(pathname)
+ }
+ return err
+
+ },
+ )
+
c.MustParse(os.Args[1:], func(err error) {
if cache != nil {
cache.Close()