Skip to content

Commit

Permalink
fix version handling
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio committed Dec 29, 2023
1 parent 064ec2e commit f150cf9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ clean:
version.txt

version.txt: deps
cp -f version/version.txt version.txt
cp -f ./internal/version/version.txt version.txt

list:
@echo $(BINS) | tr ' ' '\n'
Expand Down
6 changes: 3 additions & 3 deletions internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import (

//go:generate sh generate_version.sh
//go:embed version.txt

Check failure on line 11 in internal/version/version.go

View workflow job for this annotation

GitHub Actions / lint

pattern version.txt: no matching files found (typecheck)

Check failure on line 11 in internal/version/version.go

View workflow job for this annotation

GitHub Actions / Analyze (go)

pattern version.txt: no matching files found

Check failure on line 11 in internal/version/version.go

View workflow job for this annotation

GitHub Actions / goreleaser

pattern version.txt: no matching files found

Check failure on line 11 in internal/version/version.go

View workflow job for this annotation

GitHub Actions / lint

pattern version.txt: no matching files found (typecheck)
var version string
var Version string

func Short() string {
return fmt.Sprintf("unixtools %s", version)
return fmt.Sprintf("unixtools %s", Version)
}

func PrintWithCopyright() {
_, _ = fmt.Println(longWithCopyright())
}

func longWithCopyright() string {
return fmt.Sprintf("alessio's unixtools, version %s\nCopyright (C) 2020, 2021, 2022, 2023 Alessio Treglia <alessio@debian.org>", strings.TrimSpace(version))
return fmt.Sprintf("alessio's unixtools, Version %s\nCopyright (C) 2020, 2021, 2022, 2023 Alessio Treglia <alessio@debian.org>", strings.TrimSpace(Version))
}

0 comments on commit f150cf9

Please sign in to comment.