diff --git a/Makefile b/Makefile index 02ca2605..02d6a099 100644 --- a/Makefile +++ b/Makefile @@ -359,4 +359,4 @@ deb: build/release @mkdir -p build/release-deb/usr/local/lib cp -ar build/release/tinygo build/release-deb/usr/local/lib/tinygo ln -sf ../lib/tinygo/bin/tinygo build/release-deb/usr/local/bin/tinygo - fpm -f -s dir -t deb -n tinygo -v $(shell grep "version = " version.go | awk '{print $$NF}') -m '@tinygo-org' --description='TinyGo is a Go compiler for small places.' --license='BSD 3-Clause' --url=https://tinygo.org/ --deb-changelog CHANGELOG.md -p build/release.deb -C ./build/release-deb + fpm -f -s dir -t deb -n tinygo -v $(shell grep "const Version = " goenv/version.go | awk '{print $$NF}') -m '@tinygo-org' --description='TinyGo is a Go compiler for small places.' --license='BSD 3-Clause' --url=https://tinygo.org/ --deb-changelog CHANGELOG.md -p build/release.deb -C ./build/release-deb diff --git a/goenv/version.go b/goenv/version.go index 7c0d10f6..51144705 100644 --- a/goenv/version.go +++ b/goenv/version.go @@ -10,6 +10,10 @@ import ( "strings" ) +// Version of TinyGo. +// Update this value before release of new version of software. +const Version = "0.14.0-dev" + // GetGorootVersion returns the major and minor version for a given GOROOT path. // If the goroot cannot be determined, (0, 0) is returned. func GetGorootVersion(goroot string) (major, minor int, err error) { diff --git a/main.go b/main.go index 27836d1a..9fe0b240 100644 --- a/main.go +++ b/main.go @@ -632,7 +632,7 @@ func getDefaultPort() (port string, err error) { func usage() { fmt.Fprintln(os.Stderr, "TinyGo is a Go compiler for small places.") - fmt.Fprintln(os.Stderr, "version:", version) + fmt.Fprintln(os.Stderr, "version:", goenv.Version) fmt.Fprintf(os.Stderr, "usage: %s command [-printir] [-target=] -o \n", os.Args[0]) fmt.Fprintln(os.Stderr, "\ncommands:") fmt.Fprintln(os.Stderr, " build: compile packages and dependencies") @@ -900,7 +900,7 @@ func main() { if s, err := goenv.GorootVersionString(goenv.Get("GOROOT")); err == nil { goversion = s } - fmt.Printf("tinygo version %s %s/%s (using go version %s and LLVM version %s)\n", version, runtime.GOOS, runtime.GOARCH, goversion, llvm.Version) + fmt.Printf("tinygo version %s %s/%s (using go version %s and LLVM version %s)\n", goenv.Version, runtime.GOOS, runtime.GOARCH, goversion, llvm.Version) case "env": if flag.NArg() == 0 { // Show all environment variables. diff --git a/version.go b/version.go deleted file mode 100644 index 0d35efa1..00000000 --- a/version.go +++ /dev/null @@ -1,5 +0,0 @@ -package main - -// version of this package. -// Update this value before release of new version of software. -const version = "0.14.0-dev"