bust/pkg/cli/custom.go

20 lines
348 B
Go
Raw Normal View History

2022-10-30 18:46:00 +01:00
package cli
import (
"context"
"fmt"
"github.com/spf13/cobra"
)
func NewCustomGoBuild(command string, runf func(ctx context.Context) error) error {
cmd := &cobra.Command{
Use: fmt.Sprintf("dagger-go build %s", command),
RunE: func(cmd *cobra.Command, args []string) error {
return runf(cmd.Context())
},
}
return cmd.Execute()
}