diff --git a/CHANGELOG.md b/CHANGELOG.md index efc441187be8ec5046a7f5704087167a03a93ae1..65623b7ea697c7723477d30db6015a9bb11d7e0b 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 ee90284c27f187a315f1267b063fa81b5b84f613..90a27f9cea6e8f02e05a8bbab5d14650e3e932af 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.4 +1.0.5 diff --git a/shells/abstract.go b/shells/abstract.go index d7de4547937b88bd94bf39e3e19d44c6837e8677..df2590c5d57401605513a739142c553a52c94951 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 1abe9fd80e1139be2afe724e2c5ab9c15e3e9563..ac061346b90c6fc82d8250ca1e4eafbb8dd1a70a 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 c21e78b5414a895e6cd98424924c183a689c5834..b230de555ab9e724ab5be41cfaca6ad33a3ac7b2 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 b2816059138e314ed1cf7f03cd7226f7d8ef04fc..7dda17279ece3b24b3110f358f77528c598e4ca3 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++ }