Skip to content

Commit

Permalink
Merge pull request #48 from passbolt/fix-version
Browse files Browse the repository at this point in the history
Use goreleaser version if available, otherwise use buildinfo
  • Loading branch information
speatzle authored Apr 5, 2024
2 parents b269e85 + 1e09efc commit b11702d
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 488 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ jobs:
name: Generate Man and Completions
run: |
mkdir completion
go run main.go completion bash > completion/bash
go run main.go completion zsh > completion/zsh
go run main.go completion fish > completion/fish
go run main.go completion powershell > completion/powershell
go run *.go completion bash > completion/bash
go run *.go completion zsh > completion/zsh
go run *.go completion fish > completion/fish
go run *.go completion powershell > completion/powershell
mkdir man
go run main.go gendoc --type man
go run *.go gendoc --type man
pwd
ls
-
Expand Down
8 changes: 6 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ func initConfig() {
}
}

func SetVersionInfo(version, commit, date string) {
rootCmd.Version = fmt.Sprintf("%s (Built on %s from Git SHA %s)", version, date, commit)
func SetVersionInfo(version, commit, date string, dirty bool) {
v := fmt.Sprintf("%s (Built on %s from Git SHA %s)", version, date, commit)
if dirty {
v = v + " dirty"
}
rootCmd.Version = v
}
4 changes: 0 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ toolchain go1.21.7

require (
github.com/alessio/shellescape v1.4.2
github.com/carlmjohnson/versioninfo v0.22.5
github.com/google/cel-go v0.20.1
github.com/passbolt/go-passbolt v0.7.0
github.com/pterm/pterm v0.12.79
Expand All @@ -23,10 +22,7 @@ require (
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect
github.com/ProtonMail/gopenpgp/v2 v2.7.5 // indirect
github.com/aead/argon2 v0.0.0-20180111183520-a87724528b07 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/console v1.0.4 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
Expand Down
Loading

0 comments on commit b11702d

Please sign in to comment.