From 4905e00318d7299866979f1ad2d5c89cd42bdc1c Mon Sep 17 00:00:00 2001 From: Mat Ryer Date: Thu, 11 Mar 2021 20:28:52 +0000 Subject: [PATCH] better testing experience --- .gitignore | 1 + app/main.go | 5 +++-- app/package.sh | 1 + app/test.sh | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ec05f8bda..bec62b845 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ app/.DS_Store xbarapp.com/public/.DS_Store app/assets/mac/info.plist tools/sitegen/.version +app/.version diff --git a/app/main.go b/app/main.go index 0262700b8..05c1ca95f 100644 --- a/app/main.go +++ b/app/main.go @@ -1,6 +1,7 @@ package main import ( + _ "embed" "fmt" "os" @@ -10,8 +11,8 @@ import ( "github.com/wailsapp/wails/v2/pkg/options/mac" ) -// version is the xbar version (set by the git tag in build.sh). -var version string = "dev" +//go:embed .version +var version string func main() { println("xbar", version) diff --git a/app/package.sh b/app/package.sh index 6165f56f9..3f1882404 100755 --- a/app/package.sh +++ b/app/package.sh @@ -12,6 +12,7 @@ VERSION=`git describe --tags` echo "" echo " xbar ${VERSION}..." echo "" +echo -n $VERSION > .version # run all tests ./test.sh diff --git a/app/test.sh b/app/test.sh index 683d4180d..178e313c5 100755 --- a/app/test.sh +++ b/app/test.sh @@ -2,6 +2,8 @@ set -e +VERSION=`git describe --tags` + go test cd ../pkg/metadata @@ -17,6 +19,7 @@ go test cd ../../app cd ../tools/sitegen +echo -n $VERSION > .version go test -short cd ../../app