Commit 864fdbfa authored by Kamil Trzciński's avatar Kamil Trzciński

Fix: Error level checking for Windows Batch and PowerShell

Fixes https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/1142
parent b23dff65
......@@ -18,8 +18,9 @@ v 1.1.0
- Fix: Make the shell executor more verbose when the process cannot be started
- Fix: Pass gitlab-ci.yml variables to build container created by docker executor
- Fix: Don't restore cache if not defined in gitlab-ci.yml
- Fix: always use `json-file` when starting docker containers
- Fix: Always use `json-file` when starting docker containers
- Fix: Error level checking for Windows Batch and PowerShell
v 1.0.4
- Fix support for Windows PowerShell
......
......@@ -215,6 +215,7 @@ func (b *AbstractShell) GenerateCommands(w ShellWriter, info common.ShellScriptI
w.EmptyLine()
}
w.Line(command)
w.CheckForErrors()
}
}
......
......@@ -29,6 +29,9 @@ func (b *BashWriter) Line(text string) {
b.WriteString(strings.Repeat(" ", b.indent) + text + "\n")
}
func (b *BashWriter) CheckForErrors() {
}
func (b *BashWriter) Indent() {
b.indent++
}
......
......@@ -52,6 +52,10 @@ func (b *CmdWriter) Line(text string) {
b.WriteString(strings.Repeat(" ", b.indent) + text + "\r\n")
}
func (b *CmdWriter) CheckForErrors() {
b.checkErrorLevel()
}
func (b *CmdWriter) Indent() {
b.indent++
}
......
......@@ -47,6 +47,10 @@ func (b *PsWriter) Line(text string) {
b.WriteString(strings.Repeat(" ", b.indent) + text + "\r\n")
}
func (b *PsWriter) CheckForErrors() {
b.checkErrorLevel()
}
func (b *PsWriter) Indent() {
b.indent++
}
......
......@@ -6,6 +6,7 @@ type ShellWriter interface {
Variable(variable common.BuildVariable)
Command(command string, arguments ...string)
Line(text string)
CheckForErrors()
IfDirectory(path string)
IfFile(file string)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment