0
0
mirror of https://github.com/thegeeklab/wp-git-action.git synced 2024-11-24 22:50:39 +00:00
wp-git-action/plugin/plugin.go

47 lines
710 B
Go
Raw Normal View History

2022-11-27 13:33:39 +00:00
package plugin
import (
"github.com/thegeeklab/wp-git-action/git"
wp "github.com/thegeeklab/wp-plugin-go/plugin"
"github.com/urfave/cli/v2"
2022-11-27 13:33:39 +00:00
)
2023-08-21 09:41:28 +00:00
// Plugin implements provide the plugin.
2022-11-27 13:33:39 +00:00
type Plugin struct {
*wp.Plugin
Settings *Settings
2022-11-27 13:33:39 +00:00
}
// Settings for the Plugin.
type Settings struct {
Action cli.StringSlice
SSHKey string
Netrc Netrc
Pages Pages
Repo git.Repository
}
type Netrc struct {
Machine string
Login string
Password string
}
type Pages struct {
Directory string
Exclude cli.StringSlice
Delete bool
}
func New(options wp.Options, settings *Settings) *Plugin {
p := &Plugin{}
options.Execute = p.run
p.Plugin = wp.New(options)
p.Settings = settings
return p
2022-11-27 13:33:39 +00:00
}