Skip to content

Commit 64e7cba

Browse files
committed
parameterise cliVersion
1 parent c96f58e commit 64e7cba

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

cmd/root.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ import (
1111

1212
var username string
1313
var password string
14+
var cliVersion string
1415

1516
// rootCmd represents the base command when called without any subcommands
1617
var rootCmd = &cobra.Command{
17-
Version: "0.2.0",
18+
Version: cliVersion,
1819
Use: "vcc",
1920
Short: "Download binaries from customerconnect.vmware.com",
2021
Long: "vcc downloads binaries from customerconnect.vmware.com",

scripts/build.sh

+9-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ set -eu
77
readonly verison=$1
88
readonly script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.."
99

10-
env GOOS=linux GOARCH=amd64 go build -o ${script_dir}/builds/vcc-linux-v${verison}
10+
env GOOS=linux GOARCH=amd64 go build \
11+
-ldflags="-X 'github.com/vmware-labs/vmware-customer-connect-cli/cmd.cliVersion=${verison}'" \
12+
-o ${script_dir}/builds/vcc-linux-v${verison}
1113

12-
env GOOS=darwin GOARCH=amd64 go build -o ${script_dir}/builds/vcc-darwin-v${verison}
14+
env GOOS=darwin GOARCH=amd64 go build \
15+
-ldflags="-X github.com/vmware-labs/vmware-customer-connect-cli/cmd.cliVersion=${verison}" \
16+
-o ${script_dir}/builds/vcc-darwin-v${verison}
1317

14-
env GOOS=windows GOARCH=amd64 go build -o ${script_dir}/builds/vcc-windows-v${verison}.exe
18+
env GOOS=windows GOARCH=amd64 go build \
19+
-ldflags="-X github.com/vmware-labs/vmware-customer-connect-cli/cmd.cliVersion=${verison}" \
20+
-o ${script_dir}/builds/vcc-windows-v${verison}.exe

0 commit comments

Comments
 (0)