Skip to content

Commit

Permalink
fix version variable
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-kiselenko committed Jul 18, 2024
1 parent 01615cc commit 22fdb6c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,4 @@ builds:
- amd64
goarm:
- 6
- 7
ldflags:
# use commit date instead of current date as main.date
# only needed if you actually use those things in your main package, otherwise can be ignored.
- -s -w -X main.version={{.Version}}
- 7
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ all: help

## Build:
build: ## Build all the binaries and put the output in bin/
$(GOCMD) build -ldflags "-X main.Version=$(BRANCH)-$(HASH)" -o bin/smolgit .
$(GOCMD) build -ldflags "-X main.version=$(BRANCH)-$(HASH)" -o bin/smolgit .

## Config:
config: ## Generate default config
Expand Down
4 changes: 2 additions & 2 deletions smollgit.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

var (
Version = "dev"
version = "dev"
configPath = flag.String("config", "./config.yaml", "path to config")
)

Expand All @@ -32,7 +32,7 @@ func main() {
sigchnl := make(chan os.Signal, 1)
signal.Notify(sigchnl, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM)
exitchnl := make(chan int)
app, err := cmd.New(Version, configPath, exitchnl, sigchnl)
app, err := cmd.New(version, configPath, exitchnl, sigchnl)
if err != nil {
log.Fatalf("failed to init app: %s", err)
}
Expand Down

0 comments on commit 22fdb6c

Please sign in to comment.