[#3685] added the release notes to the success ghupdate output
This commit is contained in:
parent
4e51e393a2
commit
8961232a44
|
@ -245,6 +245,16 @@ func (p *plugin) update(withBackup bool) error {
|
||||||
color.HiBlack("---")
|
color.HiBlack("---")
|
||||||
color.Green("Update completed successfully! You can start the executable as usual.")
|
color.Green("Update completed successfully! You can start the executable as usual.")
|
||||||
|
|
||||||
|
// print the release notes
|
||||||
|
if latest.Body != "" {
|
||||||
|
fmt.Print("\n")
|
||||||
|
color.Cyan("Here is a list with some of the %s changes:", latest.Tag)
|
||||||
|
// remove the update command note to avoid "stuttering"
|
||||||
|
releaseNotes := strings.TrimSpace(strings.Replace(latest.Body, "> _To update the prebuilt executable you can run `./pocketbase update`._", "", 1))
|
||||||
|
color.Cyan(releaseNotes)
|
||||||
|
fmt.Print("\n")
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,19 +6,20 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type releaseAsset struct {
|
type releaseAsset struct {
|
||||||
Id int `json:"id"`
|
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Size int `json:"size"`
|
|
||||||
DownloadUrl string `json:"browser_download_url"`
|
DownloadUrl string `json:"browser_download_url"`
|
||||||
|
Id int `json:"id"`
|
||||||
|
Size int `json:"size"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type release struct {
|
type release struct {
|
||||||
Id int `json:"id"`
|
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Tag string `json:"tag_name"`
|
Tag string `json:"tag_name"`
|
||||||
Published string `json:"published_at"`
|
Published string `json:"published_at"`
|
||||||
Url string `json:"html_url"`
|
Url string `json:"html_url"`
|
||||||
|
Body string `json:"body"`
|
||||||
Assets []*releaseAsset `json:"assets"`
|
Assets []*releaseAsset `json:"assets"`
|
||||||
|
Id int `json:"id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// findAssetBySuffix returns the first available asset containing the specified suffix.
|
// findAssetBySuffix returns the first available asset containing the specified suffix.
|
||||||
|
|
Loading…
Reference in New Issue