Skip to content
Snippets Groups Projects
Unverified Commit 58f4ee75 authored by Kali Kaneko's avatar Kali Kaneko Committed by Kali Kaneko
Browse files

[feat] get version from file

if we're running from snap, we take the version string from a file in
the snap folder.

the version.sh script is executed during the creation of the snap, and
is expected to write a version.txt file in the snap/ folder.
parent 34ed78a1
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@
package main
import (
"io/ioutil"
"os"
"path"
"runtime"
......@@ -71,6 +72,12 @@ func (n *notificator) donations() {
}
func (n *notificator) about(version string) {
if version == "" && os.Getenv("SNAP") != "" {
_version, err := ioutil.ReadFile(os.Getenv("SNAP") + "/snap/version.txt")
if err == nil {
version = string(_version)
}
}
dialog.Message(printer.Sprintf(aboutText, applicationName, version)).
Title(printer.Sprintf("About")).
Icon(getIconPath()).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment