Skip to content

Commit

Permalink
Fix update bug
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelGoerentz committed Jul 8, 2024
1 parent 12151ec commit 1fe2789
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func BinaryUpdate() (err error) {
case "Main", "Beta":
var releaseInfo = fmt.Sprintf("%s/releases", System.Update.Github)
var latest string
var bin_name string
var body []byte

var git []*GithubReleaseInfo
Expand All @@ -64,7 +65,9 @@ func BinaryUpdate() (err error) {
for _, release := range git {
if release.Prerelease {
latest = release.TagName
bin_name = fmt.Sprintf("Threadfin_beta_%s_%s", System.OS, System.ARCH)
updater.Response.Version = release.TagName
showInfo("TAG LATEST:" + release.TagName)
break
}
}
Expand All @@ -74,15 +77,16 @@ func BinaryUpdate() (err error) {
if System.Branch == "Main" {
for _, release := range git {
if !release.Prerelease {
updater.Response.Version = release.TagName
latest = release.TagName
bin_name = fmt.Sprintf("Threadfin_%s_%s", System.OS, System.ARCH)
updater.Response.Version = release.TagName
showInfo("TAG LATEST:" + release.TagName)
break
}
}
}

var File = fmt.Sprintf("%s/releases/download/%s/%s_%s_%s", System.Update.Git, latest, "Threadfin", System.OS, System.ARCH)
var File = fmt.Sprintf("%s/releases/download/%s/%s", System.Update.Git, latest, bin_name)

updater.Response.Status = true
updater.Response.UpdateBIN = File
Expand Down
4 changes: 2 additions & 2 deletions threadfin.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ var GitHub = GitHubStruct{Branch: "Main", User: "marcelGoerentz", Repo: "Threadf
const Name = "Threadfin"

// Version : Version, die Build Nummer wird in der main func geparst.
const Version = "1.1.16"
const Version = "1.1.17"

// DBVersion : Datanbank Version
const DBVersion = "0.5.0"

// APIVersion : API Version
const APIVersion = "1.1.16"
const APIVersion = "1.1.17"

var homeDirectory = fmt.Sprintf("%s%s.%s%s", src.GetUserHomeDirectory(), string(os.PathSeparator), strings.ToLower(Name), string(os.PathSeparator))
var samplePath = fmt.Sprintf("%spath%sto%sthreadfin%s", string(os.PathSeparator), string(os.PathSeparator), string(os.PathSeparator), string(os.PathSeparator))
Expand Down

0 comments on commit 1fe2789

Please sign in to comment.