diff --git a/cmd/cmd.go b/cmd/cmd.go index 6becea6..98a9824 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -244,9 +244,22 @@ func Main() *cli.App { return false } - if !hasPath() { + var hasModule = func() bool { + for _, opt := range opts { + if strings.HasPrefix(opt, "module=") { + return true + } + } + return false + } + + if !hasPath() && basePlugin.Paths != "" { opts = append(opts, fmt.Sprintf("paths=%s", basePlugin.Paths)) } + + if !hasModule() && basePlugin.Module != "" { + opts = append(opts, fmt.Sprintf("module=%s", basePlugin.Module)) + } } if plg.Shell != "" || plg.Docker != "" { diff --git a/cmd/config.go b/cmd/config.go index 1720214..fe75cdc 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -47,8 +47,9 @@ type Cfg struct { } type basePluginCfg struct { - Out string `yaml:"out,omitempty"` - Paths string `yaml:"paths,omitempty"` + Out string `yaml:"out,omitempty"` + Paths string `yaml:"paths,omitempty"` + Module string `yaml:"module,omitempty"` } type plugin struct {