Compare commits

...

2 Commits

Author SHA1 Message Date
jolheiser 4b65d05dcc
fix: correct if-logic for update
ci/woodpecker/push/goreleaser Pipeline was successful Details
ci/woodpecker/tag/goreleaser Pipeline was successful Details
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-01-30 22:07:36 -06:00
jolheiser 3bccb54f54
fix: re-structure update check
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-01-30 22:04:33 -06:00
1 changed files with 11 additions and 3 deletions

14
main.go
View File

@ -56,10 +56,18 @@ func main() {
}
uri := fs.Arg(0)
if *updateFlag && strings.Index(uri, "/") == -1 {
if pkg, ok := m.Packages[uri]; ok {
uri = pkg.Repo
if strings.Index(uri, "/") == -1 {
if !*updateFlag {
fmt.Printf("%q was not a URI and --update was not passed\n", uri)
return
}
pkg, ok := m.Packages[uri]
if !ok {
fmt.Printf("%q was not a URI and didn't match an installed package\n", uri)
return
}
uri = pkg.Repo
}
f, err = forge.NewGitea(uri)