Add support for step.working-directory (closes #149) (#154)

This commit is contained in:
Aidan Steele
2020-03-14 18:00:37 +11:00
committed by GitHub
parent d2d5c90a36
commit b670173764
4 changed files with 24 additions and 0 deletions

View File

@@ -110,6 +110,13 @@ func (sc *StepContext) setupShellCommand() common.Executor {
return err
}
if step.WorkingDirectory != "" {
_, err = script.WriteString(fmt.Sprintf("cd %s\n", step.WorkingDirectory))
if err != nil {
return err
}
}
run := rc.ExprEval.Interpolate(step.Run)
if _, err = script.WriteString(run); err != nil {