Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #68 from paulbouwer/67-exit-code-propagation
Browse files Browse the repository at this point in the history
Issue #67 - Exit codes from scriptcs.exe are not propagated
  • Loading branch information
paulbouwer committed Mar 30, 2015
2 parents 1fd508a + ebd9aec commit ba3dced
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/shims/scriptcs.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@echo off

PowerShell -NoProfile -NoLogo -ExecutionPolicy Unrestricted -Command "& '%~dp0scriptcs.ps1' -- %*"
EXIT /B %ERRORLEVEL%
8 changes: 6 additions & 2 deletions src/shims/scriptcs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,29 @@ function Get-ScriptCsExecutable
# shim
#

$EXITCODE_ERROR = 1

try
{
$version = Get-ActiveVersion
if (String-IsEmptyOrWhitespace($version))
{
Write-ErrorMessage "No active scriptcs found. Use 'svm use <version>' to set the active scriptcs version."
exit
exit $EXITCODE_ERROR
}

$scriptcs = Get-ScriptCsExecutable $version
if (!(Test-Path $scriptcs))
{
Write-ErrorMessage "The active scriptcs could not be found at '$scriptcs'. Use 'svm use <version>' to correctly set the active scriptcs version."
exit
exit $EXITCODE_ERROR
}

&$scriptcs $args
exit $LASTEXITCODE
}
catch
{
Write-ErrorMessage $_
exit $EXITCODE_ERROR
}

0 comments on commit ba3dced

Please sign in to comment.