Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
Fixed version and build flags

Fixed goreleaser version
  • Loading branch information
ondrovic committed Sep 9, 2024
1 parent 9bedde0 commit 566fe28
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export GO111MODULE=on
GOOS := $(shell go env GOOS)
VERSION := $(shell git describe --tags --always)
BUILD_FLAGS := -ldflags="-X 'main.version=$(VERSION)'"
BUILD_FLAGS := -ldflags="-X 'github.com/ondrovic/folder-structure-cli/cmd.Version=$(VERSION)'"
# update to main app path
APP_PATH := main.go
APP_PATH := folder-structure-cli.go

# determins the variables based on GOOS
ifeq ($(GOOS), windows)
Expand Down
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (
)

var (
version *string
Version string
)

func checkVersion() string {
if version == nil {
if Version == "" {
return "0.0.0"
}

return *version
return Version
}

var RootCmd = &cobra.Command{
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ version: 2
project_name: folder-structure-cli

env:
- GO_MAIN_PATH=main.go
- VERSION_PATH=folder-structure-cli/cmd/root.version
- GO_MAIN_PATH=folder-structure-cli.go
- VERSION_PATH=github.com/ondrovic/folder-structure-cli/cmd.Version


before:
Expand Down

0 comments on commit 566fe28

Please sign in to comment.