Skip to content

Commit

Permalink
add version to command
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanejohnson committed Jul 1, 2023
1 parent 17a7c67 commit 8ed382a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ for GOOS in "${GOOSES[@]}"; do
fi
FILENAME="${NAME}_${RELEASE}_${GOOS}_${GOARCH}${SUFFIX}"
echo building "${FILENAME}"
GOOS=${GOOS} GOARCH=${GOARCH} CGO_ENABLED=0 go build -o "${FILENAME}"
GOOS=${GOOS} GOARCH=${GOARCH} CGO_ENABLED=0 go build -o "${FILENAME}" -ldflags "-X main.version=${RELEASE}"
done
done

4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import (
"github.com/nathanejohnson/whichca/cmd"
)

var version = ""

func main() {
log := logpkg.New(os.Stdout, "", 0)
c := cli.NewCLI(os.Args[0], "")
c := cli.NewCLI(os.Args[0], version)
c.Commands = map[string]cli.CommandFactory{
"minca": func() (cli.Command, error) {
return cmd.NewMinCACmd(), nil
Expand Down

0 comments on commit 8ed382a

Please sign in to comment.