-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathexport_go.go
More file actions
30 lines (24 loc) · 638 Bytes
/
export_go.go
File metadata and controls
30 lines (24 loc) · 638 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package variant
import (
"github.com/spf13/cobra"
)
func newExportGo(r *Runner) *cobra.Command {
return &cobra.Command{
Use: "go SRC_DIR DST_DIR",
Short: "Copy and generate DST_DIR/main.go for building the single executable binary with `go build DST_DIR`",
Example: `$ variant export go examples/simple build
$ go build -o build/simple ./build
$ build/simple -h
$ build/simple app deploy -n default
`,
Args: cobra.ExactArgs(2),
RunE: func(c *cobra.Command, args []string) error {
err := r.ap.ExportGo(args[0], args[1])
if err != nil {
c.SilenceUsage = true
}
//nolint:wrapcheck
return err
},
}
}