feat: shorthand syntax
ci/woodpecker/push/goreleaser Pipeline was successful Details
ci/woodpecker/tag/goreleaser Pipeline was successful Details

Signed-off-by: jolheiser <john.olheiser@gmail.com>
main v0.0.6
jolheiser 2023-02-01 21:57:42 -06:00
parent d8f45eb0b9
commit ad08d24312
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
1 changed files with 9 additions and 0 deletions

View File

@ -14,6 +14,11 @@ import (
var Version = "develop"
func main() {
base := "github.com/"
if b, ok := os.LookupEnv("EGET_BASE"); ok {
base = strings.TrimSuffix(b, "/") + "/"
}
fs := flag.NewFlagSet("eget", flag.ExitOnError)
fs.Usage = func() {
fmt.Fprintln(fs.Output(), "eget <package>")
@ -72,6 +77,10 @@ func main() {
uri = pkg.Repo
}
if strings.Count(uri, "/") == 1 {
uri = base + uri
}
f, err = forge.NewGitea(uri)
if strings.HasPrefix(uri, "github") {
f, err = forge.NewGitHub(uri)