Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Commit

Permalink
Fixes #360 - Pass the exit code from the binned batch file.
Browse files Browse the repository at this point in the history
  • Loading branch information
ferventcoder committed Oct 29, 2013
1 parent 72900ea commit 597b2e6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/functions/Generate-BinFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ param(
Write-Host "Adding $packageBashFileName and pointing to `'$path`'." -ForegroundColor $Note
if ($useStart) {
Write-Host "Setting up $name as a non-command line application." -ForegroundColor $Note

"@echo off
SET DIR=%~dp0%
start """" ""$path"" %*" | Out-File $packageBatchFileName -encoding ASCII
Expand All @@ -23,12 +24,16 @@ DIR=`${0%/*}
""$pathBash"" ""`$*"" &" | Out-File $packageBashFileName -encoding ASCII

} else {

"@echo off
SET DIR=%~dp0%
""$path"" %*" | Out-File $packageBatchFileName -encoding ASCII

cmd /c ""$path"" %*
exit /b %ERRORLEVEL%" | Out-File $packageBatchFileName -encoding ASCII

"#!/bin/sh
DIR=`${0%/*}
""$pathBash"" ""`$*""" | Out-File $packageBashFileName -encoding ASCII
""$pathBash"" ""`$*""
exit `$?" | Out-File $packageBashFileName -encoding ASCII

}
}

0 comments on commit 597b2e6

Please sign in to comment.