diff --git a/CHANGELOG.md b/CHANGELOG.md index f2cc09a8..8443de94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - #1178: Add `-password-env` and `-token-env` modifiers to the `repo` command to read the password/token from a named environment variable (secure alternatives to `-password` and `-token`). +### Changed +- #1186: Change %IPM.Main:ShellScript() to return a status. + ### Fixed - #1207: Zero-byte files are now supported in IPM modules diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index 98d1fd40..21eef44d 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -4073,7 +4073,8 @@ ClassMethod History(ByRef pCommandInfo) ClassMethod ShellScript( pCommand As %String, pOutputLogFile As %String = "", - pAppendToLog As %Boolean = 0) + pAppendToLog As %Boolean = 0, + pTerminateOnError As %Boolean = 1) As %Status { set tSC = $$$OK set tFileOpen = 0 @@ -4105,10 +4106,12 @@ ClassMethod ShellScript( close pOutputLogFile } - if $$$ISERR(tSC) { + if (pTerminateOnError && $$$ISERR(tSC)) { // Set ERRORLEVEL to 1 do $system.Process.Terminate(,1) } + + return tSC } ClassMethod DisplayModules(