diff --git a/main.go b/main.go index 2c52800..0e8891d 100644 --- a/main.go +++ b/main.go @@ -81,11 +81,6 @@ func main() { EnvVar: "PLUGIN_URL", Value: "", }, - cli.BoolFlag{ - Name: "validate", - Usage: "validate config file before generation", - EnvVar: "PLUGIN_VALIDATE", - }, cli.StringFlag{ Name: "hugoversion", Usage: "the hugo version to be used", @@ -110,7 +105,6 @@ func run(c *cli.Context) error { Drafts: c.Bool("drafts"), Expired: c.Bool("expired"), Future: c.Bool("future"), - Validate: c.Bool("validate"), Config: c.String("config"), Content: c.String("content"), Layout: c.String("layout"), diff --git a/plugin_test.go b/plugin_test.go index 2cf047e..d940abf 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -2,28 +2,8 @@ package main import ( "testing" - - "github.com/pkg/errors" ) -func TestCommandValidate(t *testing.T) { - config := Config{Validate: true} - want := []string{"hugo", "check"} - got := commandValidate(config) - - if err := argsEqual(want, got.Args); err != nil { - t.Errorf("%s", err) - } - - config = Config{Validate: true, Config: "config.toml"} - want = []string{"hugo", "check", "--config", "config.toml"} - got = commandValidate(config) - - if err := argsEqual(want, got.Args); err != nil { - t.Errorf("%s", err) - } -} - func TestVersionEqual(t *testing.T) { want := true if got := versionsEqual("1.0", "1.0"); want != got { @@ -35,12 +15,3 @@ func TestVersionEqual(t *testing.T) { t.Errorf("want: %t, got: %t", want, got) } } - -func argsEqual(want []string, got []string) error { - for i := range want { - if want[i] != got[i] { - return errors.Errorf("Arguments do not match, want: %s, got: %s", want[i], got[i]) - } - } - return nil -}