File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import (
2727)
2828
2929const PluginDir = ".semrel"
30+ const PluginAPI = "https://plugins.go-semantic-release.xyz/api/v1"
3031
3132var osArchDir = runtime .GOOS + "_" + runtime .GOARCH
3233
@@ -73,14 +74,17 @@ type apiPlugin struct {
7374}
7475
7576func getPluginInfo (name string ) (* apiPlugin , error ) {
76- res , err := http .Get (fmt .Sprintf ("https:// plugins.go-semantic-release.xyz/api/v1/plugins/ %s.json" , name ))
77+ res , err := http .Get (fmt .Sprintf ("%s/ plugins/ %s.json" , PluginAPI , name ))
7778 if err != nil {
7879 return nil , err
7980 }
81+ defer res .Body .Close ()
82+ if res .StatusCode == 404 {
83+ return nil , fmt .Errorf ("plugin not found: %s" , name )
84+ }
8085 if res .StatusCode < 200 || res .StatusCode >= 300 {
8186 return nil , errors .New ("invalid response" )
8287 }
83- defer res .Body .Close ()
8488 var plugin * apiPlugin
8589 if err := json .NewDecoder (res .Body ).Decode (& plugin ); err != nil {
8690 return nil , err
You can’t perform that action at this time.
0 commit comments