Skip to content

Commit

Permalink
Merge pull request #51 from noborus/fix-verison-print
Browse files Browse the repository at this point in the history
Fixed so that version is output correctly
  • Loading branch information
noborus authored Mar 1, 2024
2 parents 4a9d08c + 05d2322 commit 1dade73
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ builds:
id: ovcs-linux
binary: ovcs
ldflags:
- -X main.Version={{.Version}}
- -X main.Revision={{.ShortCommit}}
- -X github.com/noborus/ovcs/cmd.Version={{.Version}}
- -X github.com/noborus/ovcs/cmd.Revision={{.ShortCommit}}
env:
- CGO_ENABLED=0
goos:
Expand All @@ -20,8 +20,8 @@ builds:
id: ovcs-other
binary: ovcs
ldflags:
- -X main.Version={{.Version}}
- -X main.Revision={{.ShortCommit}}
- -X github.com/noborus/ovcs/cmd.Version={{.Version}}
- -X github.com/noborus/ovcs/cmd.Revision={{.ShortCommit}}
env:
- CGO_ENABLED=0
goos:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BINARY_NAME := ovcs
SRCS := $(shell git ls-files '*.go')
LDFLAGS := "-X main.Version=$(shell git describe --tags --abbrev=0 --always) -X main.Revision=$(shell git rev-parse --verify --short HEAD)"
LDFLAGS := "-X github.com/noborus/ovcs/cmd.Version=$(shell git describe --tags --abbrev=0 --always) -X github.com/noborus/ovcs/cmd.Revision=$(shell git rev-parse --verify --short HEAD)"

all: build

Expand Down
5 changes: 3 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ var cfgFile string

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "ovcs",
Short: "The client/server of the terminal pager ov",
Use: "ovcs",
Version: fmt.Sprintf("%s (rev: %s)", Version, Revision),
Short: "The client/server of the terminal pager ov",
Long: `This is the client/server method version of terminal pager ov.
Pipe to client to be displayed on server.`,
}
Expand Down

0 comments on commit 1dade73

Please sign in to comment.