fix: re-structure update check
Signed-off-by: jolheiser <john.olheiser@gmail.com>main
parent
dd84c45c71
commit
3bccb54f54
14
main.go
14
main.go
|
@ -56,10 +56,18 @@ func main() {
|
||||||
}
|
}
|
||||||
uri := fs.Arg(0)
|
uri := fs.Arg(0)
|
||||||
|
|
||||||
if *updateFlag && strings.Index(uri, "/") == -1 {
|
if strings.Index(uri, "/") != -1 {
|
||||||
if pkg, ok := m.Packages[uri]; ok {
|
if !*updateFlag {
|
||||||
uri = pkg.Repo
|
fmt.Println("provided arg must be a URI, unless using --update")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pkg, ok := m.Packages[uri]
|
||||||
|
if !ok {
|
||||||
|
fmt.Println("arg was not a URI and didn't match an installed package")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uri = pkg.Repo
|
||||||
}
|
}
|
||||||
|
|
||||||
f, err = forge.NewGitea(uri)
|
f, err = forge.NewGitea(uri)
|
||||||
|
|
Reference in New Issue