feat: add --output-dir on template command (#693)

It generates templates in a subdirectory named "stateFileName-stateFileHash-releaseName"
This commit is contained in:
OlivierB
2019-07-11 09:07:46 +09:00
committed by KUOKA Yusuke
parent 63b5040ec4
commit 2f9f52033c
11 changed files with 252 additions and 16 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ type Runner interface {
type ShellRunner struct {
Dir string
logger *zap.SugaredLogger
Logger *zap.SugaredLogger
}
// Execute a shell command
@@ -33,7 +33,7 @@ func (shell ShellRunner) Execute(cmd string, args []string, env map[string]strin
preparedCmd := exec.Command(cmd, args...)
preparedCmd.Dir = shell.Dir
preparedCmd.Env = mergeEnv(os.Environ(), env)
return combinedOutput(preparedCmd, shell.logger)
return combinedOutput(preparedCmd, shell.Logger)
}
func combinedOutput(c *exec.Cmd, logger *zap.SugaredLogger) ([]byte, error) {