From 907cfa5e0682e938691ba5f5d665ff8147833a89 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski <ayufan@ayufan.eu> Date: Wed, 23 Mar 2016 13:42:14 +0100 Subject: [PATCH] Fix error level checking for Windows Batch and PowerShell --- CHANGELOG.md | 3 +++ VERSION | 2 +- shells/abstract.go | 2 ++ shells/bash.go | 3 +++ shells/cmd.go | 4 ++++ shells/powershell.go | 4 ++++ 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efc441187..65623b7ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +v 1.0.5 +- Fix error level checking for Windows Batch and PowerShell + v 1.0.4 - Fix support for Windows PowerShell diff --git a/VERSION b/VERSION index ee90284c2..90a27f9ce 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.4 +1.0.5 diff --git a/shells/abstract.go b/shells/abstract.go index d7de45479..df2590c5d 100644 --- a/shells/abstract.go +++ b/shells/abstract.go @@ -15,6 +15,7 @@ type ShellWriter interface { Variable(variable common.BuildVariable) Command(command string, arguments ...string) Line(text string) + CheckForErrors() IfDirectory(path string) IfFile(file string) @@ -148,6 +149,7 @@ func (b *AbstractShell) GenerateCommands(w ShellWriter, info common.ShellScriptI } } w.Line(command) + w.CheckForErrors() } } diff --git a/shells/bash.go b/shells/bash.go index 1abe9fd80..ac061346b 100644 --- a/shells/bash.go +++ b/shells/bash.go @@ -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++ } diff --git a/shells/cmd.go b/shells/cmd.go index c21e78b54..b230de555 100644 --- a/shells/cmd.go +++ b/shells/cmd.go @@ -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++ } diff --git a/shells/powershell.go b/shells/powershell.go index b28160591..7dda17279 100644 --- a/shells/powershell.go +++ b/shells/powershell.go @@ -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++ } -- GitLab