Implement the debug flag in lint [#3]
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package run
|
||||
|
||||
import (
|
||||
// "fmt"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Lint is an execution step that calls `helm lint` when executed.
|
||||
@@ -18,7 +18,13 @@ func (l *Lint) Execute(_ Config) error {
|
||||
|
||||
// Prepare gets the Lint ready to execute.
|
||||
func (l *Lint) Prepare(cfg Config) error {
|
||||
args := []string{"lint"}
|
||||
args := make([]string, 0)
|
||||
|
||||
if cfg.Debug {
|
||||
args = append(args, "--debug")
|
||||
}
|
||||
|
||||
args = append(args, "lint")
|
||||
|
||||
if cfg.Values != "" {
|
||||
args = append(args, "--set", cfg.Values)
|
||||
@@ -36,5 +42,9 @@ func (l *Lint) Prepare(cfg Config) error {
|
||||
l.cmd.Stdout(cfg.Stdout)
|
||||
l.cmd.Stderr(cfg.Stderr)
|
||||
|
||||
if cfg.Debug {
|
||||
fmt.Fprintf(cfg.Stderr, "Generated command: '%s'\n", l.cmd.String())
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user