cmd/mbf: expose some artifacts for curing
All checks were successful
Test / Create distribution (push) Successful in 48s
Test / Sandbox (push) Successful in 2m44s
Test / Hakurei (push) Successful in 3m55s
Test / ShareFS (push) Successful in 4m1s
Test / Hpkg (push) Successful in 4m28s
Test / Sandbox (race detector) (push) Successful in 5m1s
Test / Hakurei (race detector) (push) Successful in 6m15s
Test / Flake checks (push) Successful in 1m50s
All checks were successful
Test / Create distribution (push) Successful in 48s
Test / Sandbox (push) Successful in 2m44s
Test / Hakurei (push) Successful in 3m55s
Test / ShareFS (push) Successful in 4m1s
Test / Hpkg (push) Successful in 4m28s
Test / Sandbox (race detector) (push) Successful in 5m1s
Test / Hakurei (race detector) (push) Successful in 6m15s
Test / Flake checks (push) Successful in 1m50s
This will remain until dist is successfully bootstrapped. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user