Skip to content

Commit

Permalink
feat: add an option to set a custom kustomize binary (#62)
Browse files Browse the repository at this point in the history
Signed-off-by: Alessio Dionisi <me@alessiodionisi.com>
  • Loading branch information
alessiodionisi authored Sep 12, 2023
1 parent 277b40c commit a67147a
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,24 @@ func WithLogf(logf func(string, ...interface{})) Option {
}
}

func KustomizeBin(b string) Option {
return func(r *Runner) error {
r.KustomizeBinary = b
return nil
}
}

func New(opts ...Option) *Runner {
r := &Runner{
KustomizeBinary: "",
RunCommand: RunCommand,
CopyFile: CopyFile,
WriteFile: os.WriteFile,
ReadFile: os.ReadFile,
ReadDir: os.ReadDir,
Walk: filepath.Walk,
Exists: exists,
Logf: printf,
MakeTempDir: makeTempDir,
RunCommand: RunCommand,
CopyFile: CopyFile,
WriteFile: os.WriteFile,
ReadFile: os.ReadFile,
ReadDir: os.ReadDir,
Walk: filepath.Walk,
Exists: exists,
Logf: printf,
MakeTempDir: makeTempDir,
}

for i := range opts {
Expand Down

0 comments on commit a67147a

Please sign in to comment.