diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go index 7a0a78e..d80d0a7 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()