Commit 40b9d29e authored by Addshore's avatar Addshore 🏄
Browse files

Restrict updating to tag based releases only

Bug: T282330
Change-Id: I4f0b45d40375cde2828ac5e0e8efd49b421cdb99
parent 7d6d91d4
......@@ -40,7 +40,7 @@ var updateCmd = &cobra.Command{
Use: "update",
Short: "Checks for and performs updates",
Run: func(cmd *cobra.Command, args []string) {
updater.Check(Version)
updater.Check(Version, GitSummary)
},
}
......
......@@ -27,10 +27,17 @@ import (
)
/*Check ...*/
func Check(currentVersion string) {
func Check(currentVersion string, gitSummary string) {
selfupdate.EnableLog()
if !strings.HasPrefix(gitSummary, currentVersion) || strings.HasSuffix(gitSummary,"dirty") {
log.Println("Can only update tag built releases")
os.Exit(1)
}
log.Println("Checking version " + currentVersion)
v := semver.MustParse(strings.Trim(currentVersion,"v"))
log.Println("git summary " + gitSummary)
v := semver.MustParse(strings.Trim(gitSummary,"v"))
// TODO when builds are on wm.o then allow for a "dev" or "stable" update option
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment