File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11export GO111MODULE =on
22GOOS := $(shell go env GOOS)
33VERSION := $(shell git describe --tags --always)
4- BUILD_FLAGS := -ldflags="-X 'main.version =$(VERSION ) '"
4+ BUILD_FLAGS := -ldflags="-X 'github.com/ondrovic/folder-structure-cli/cmd.Version =$(VERSION ) '"
55# update to main app path
6- APP_PATH := main .go
6+ APP_PATH := folder-structure-cli .go
77
88# determins the variables based on GOOS
99ifeq ($(GOOS ) , windows)
Original file line number Diff line number Diff line change @@ -6,15 +6,15 @@ import (
66)
77
88var (
9- version * string
9+ Version string
1010)
1111
1212func checkVersion () string {
13- if version == nil {
13+ if Version == "" {
1414 return "0.0.0"
1515 }
1616
17- return * version
17+ return Version
1818}
1919
2020var RootCmd = & cobra.Command {
File renamed without changes.
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ version: 2
33project_name : folder-structure-cli
44
55env :
6- - GO_MAIN_PATH=main .go
7- - VERSION_PATH=folder-structure-cli/cmd/root.version
6+ - GO_MAIN_PATH=folder-structure-cli .go
7+ - VERSION_PATH=github.com/ondrovic/ folder-structure-cli/cmd.Version
88
99
1010before :
You can’t perform that action at this time.
0 commit comments