with custom build cli
This commit is contained in:
parent
2c06aa4353
commit
5d9a6296f1
19
pkg/cli/custom.go
Normal file
19
pkg/cli/custom.go
Normal file
@ -0,0 +1,19 @@
|
||||
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()
|
||||
}
|
Loading…
Reference in New Issue
Block a user