Skip to content

Commit

Permalink
Improve build system, report error when build fail
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Jan 4, 2025
1 parent 21bca2d commit 8a38d3f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 1k/1kiss.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ function find_prog($name, $path = $null, $mode = 'ONLY', $cmd = $null, $params =
$verStr = $(. $cmd @params 2>$null) | Select-Object -First 1
if ($LASTEXITCODE) {
Write-Warning "1kiss: Get version of $cmd fail"
$LASTEXITCODE = 0
$Global:LASTEXITCODE = 0
}
if (!$verStr -or $verStr.Contains('--version')) {
$verInfo = $cmd_info.Version
Expand Down
3 changes: 3 additions & 0 deletions tools/cmdline/axmol.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ param(

# Set-StrictMode -Version Latest

# clear last exit code
$Global:LASTEXITCODE = 0

# pwsh function alias
function println($message) { Write-Host "axmol: $message" }

Expand Down
6 changes: 5 additions & 1 deletion tools/cmdline/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ if ($forceConfig) {
. $1k_script @1k_args @forward_args @unhandled_args

if (!$configOnly) {
$1k.pause('Build done')
if ($?) {
$1k.pause('Build success')
} else {
throw "Build fail, ret=$LASTEXITCODE"
}
}
else {
$1k.pause('Generate done')
Expand Down

0 comments on commit 8a38d3f

Please sign in to comment.