Skip to content

Commit

Permalink
parameterise cliVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
laidbackware committed Jan 27, 2023
1 parent c96f58e commit 64e7cba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import (

var username string
var password string
var cliVersion string

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Version: "0.2.0",
Version: cliVersion,
Use: "vcc",
Short: "Download binaries from customerconnect.vmware.com",
Long: "vcc downloads binaries from customerconnect.vmware.com",
Expand Down
12 changes: 9 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ set -eu
readonly verison=$1
readonly script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.."

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

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

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

0 comments on commit 64e7cba

Please sign in to comment.