1.0.3
This commit is contained in:
@@ -129,25 +129,6 @@ func QuotePathForShell(path string) string {
|
||||
return fmt.Sprintf(`"%s"`, path)
|
||||
}
|
||||
|
||||
func CheckForUpdate(currentVersion string) (latestVersion, releaseNotes string, updateAvailable bool, err error) {
|
||||
resp, err := http.Get("https://api.github.com/repos/tairasu/EpochSilicon/releases/latest")
|
||||
if err != nil {
|
||||
return "", "", false, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
var data struct {
|
||||
TagName string `json:"tag_name"`
|
||||
Body string `json:"body"`
|
||||
}
|
||||
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
|
||||
return "", "", false, err
|
||||
}
|
||||
|
||||
latest := strings.TrimPrefix(data.TagName, "v")
|
||||
return latest, data.Body, latest != currentVersion, nil
|
||||
}
|
||||
|
||||
// UpdateInfo contains information about the latest release
|
||||
type UpdateInfo struct {
|
||||
TagName string `json:"tag_name"`
|
||||
|
Reference in New Issue
Block a user