0
0
mirror of https://github.com/thegeeklab/wp-gitea-release.git synced 2024-11-25 19:30:39 +00:00
wp-gitea-release/plugin/plugin.go

42 lines
646 B
Go
Raw Normal View History

2024-01-04 22:26:33 +00:00
package plugin
import (
"net/url"
wp "github.com/thegeeklab/wp-plugin-go/plugin"
"github.com/urfave/cli/v2"
)
// Plugin implements provide the plugin.
type Plugin struct {
*wp.Plugin
Settings *Settings
}
// Settings for the Plugin.
type Settings struct {
APIKey string
FileExists string
Checksum cli.StringSlice
Draft bool
PreRelease bool
Title string
Note string
CommitRef string
Event string
baseURL *url.URL
files []string
}
func New(options wp.Options, settings *Settings) *Plugin {
p := &Plugin{}
options.Execute = p.run
p.Plugin = wp.New(options)
p.Settings = settings
return p
}