Skip to content

Commit 566fe28

Browse files
committed
Bugfixes
Fixed version and build flags Fixed goreleaser version
1 parent 9bedde0 commit 566fe28

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
export GO111MODULE=on
22
GOOS := $(shell go env GOOS)
33
VERSION := $(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
99
ifeq ($(GOOS), windows)

cmd/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import (
66
)
77

88
var (
9-
version *string
9+
Version string
1010
)
1111

1212
func checkVersion() string {
13-
if version == nil {
13+
if Version == "" {
1414
return "0.0.0"
1515
}
1616

17-
return *version
17+
return Version
1818
}
1919

2020
var RootCmd = &cobra.Command{
File renamed without changes.

goreleaser.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ version: 2
33
project_name: folder-structure-cli
44

55
env:
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

1010
before:

0 commit comments

Comments
 (0)