diff --git a/github/install.go b/github/install.go index ea862f4..e47ca62 100644 --- a/github/install.go +++ b/github/install.go @@ -134,6 +134,10 @@ func installRelease(repo Repo, release Release, regex string, pack core.Pack) er } } + if len(files) == 0 { + return errors.New("release doesn't have any assets matching regex") + } + if len(files) > 1 { // TODO: also print file names return errors.New("release has more than one asset matching regex") diff --git a/github/updater.go b/github/updater.go index 9f66cb8..c970961 100644 --- a/github/updater.go +++ b/github/updater.go @@ -68,6 +68,11 @@ func (u ghUpdater) CheckUpdate(mods []*core.Mod, pack core.Pack) ([]core.UpdateC } } + if len(newFiles) == 0 { + results[i] = core.UpdateCheck{Error: errors.New("release doesn't have any assets matching regex")} + continue + } + if len(newFiles) > 1 { // TODO: also print file names results[i] = core.UpdateCheck{Error: errors.New("release has more than one asset matching regex")}