-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathexport_binary.go
More file actions
28 lines (23 loc) · 683 Bytes
/
Copy pathexport_binary.go
File metadata and controls
28 lines (23 loc) · 683 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
package variant
import (
"github.com/spf13/cobra"
)
func newExportBinary(r *Runner) *cobra.Command {
return &cobra.Command{
Use: "binary SRC_DIR DST_FILE",
Short: "Builds the single executable binary of the Variant command defined in SRC_DIR. Basically `variant export go SRC_DIR TMP_DIR && go build -o DST_FILE TMP_DIR`",
Example: `$ variant export binary examples/simple build/simple
$ build/simple -h
$ build/simple app deploy -n default
`,
Args: cobra.ExactArgs(2),
RunE: func(c *cobra.Command, args []string) error {
err := r.ap.ExportBinary(args[0], args[1])
if err != nil {
c.SilenceUsage = true
}
//nolint:wrapcheck
return err
},
}
}