summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--Makefile4
-rw-r--r--main.go10
3 files changed, 13 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9da446b..d72274a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,7 +17,7 @@ build_test:
- cd ${APP_PATH}
- go get .
- go test ./...
- - go build
+ - make build
tags:
- linux
artifacts:
diff --git a/Makefile b/Makefile
index f478300..a93bf5e 100644
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,8 @@
all: icon locales build
-build: icon catalog.go
- go build
+build:
+ go build -ldflags "-X main.version=`git describe --tags`"
clean:
make -C icon clean
diff --git a/main.go b/main.go
index 146a814..503d4ff 100644
--- a/main.go
+++ b/main.go
@@ -16,6 +16,8 @@
package main
import (
+ "flag"
+ "fmt"
"log"
"os"
@@ -29,9 +31,17 @@ const (
applicationName = "RiseupVPN"
)
+var version string
var printer *message.Printer
func main() {
+ versionFlag := flag.Bool("version", false, "Version of the bitmask-systray")
+ flag.Parse()
+ if *versionFlag {
+ fmt.Println(version)
+ os.Exit(0)
+ }
+
if _, err := os.Stat(bitmask.ConfigPath); os.IsNotExist(err) {
os.MkdirAll(bitmask.ConfigPath, os.ModePerm)
}