0
0
mirror of https://github.com/thegeeklab/wp-git-action.git synced 2024-09-20 01:12:47 +02:00
wp-git-action/plugin/plugin.go

47 lines
710 B
Go
Raw Normal View History

2022-11-27 14:33:39 +01: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 14:33:39 +01:00
)
2023-08-21 11:41:28 +02:00
// Plugin implements provide the plugin.
2022-11-27 14:33:39 +01:00
type Plugin struct {
*wp.Plugin
Settings *Settings
2022-11-27 14:33:39 +01: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 14:33:39 +01:00
}