From 5a1cb67d7f1fda766ce50c26f70c9170dc159bd5 Mon Sep 17 00:00:00 2001 From: Connection Refused Date: Sun, 26 Sep 2021 21:29:39 +0800 Subject: [PATCH] [Other] Update build.ps1 --- Other/build.ps1 | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Other/build.ps1 b/Other/build.ps1 index 6ad1bde5..47390f65 100644 --- a/Other/build.ps1 +++ b/Other/build.ps1 @@ -3,14 +3,28 @@ Push-Location (Split-Path $MyInvocation.MyCommand.Path -Parent) .\clean.ps1 Get-ChildItem -Path '.' -Directory | ForEach-Object { + Set-Location (Split-Path $MyInvocation.MyCommand.Path -Parent) + $name=$_.Name - Write-Host "Building $name" - & ".\$name\build.ps1" + if ( Test-Path ".\$name\build.ps1" ) { + Write-Host "Building $name" - if ( -Not $? ) { - Write-Host "Build $name failed" - exit $lastExitCode + & ".\$name\build.ps1" + if ( -Not $? ) { + Write-Host "Build $name failed" + exit $lastExitCode + } + } +} + +Get-ChildItem -Path '.' -Directory | ForEach-Object { + Set-Location (Split-Path $MyInvocation.MyCommand.Path -Parent) + + $name=$_.Name + + if ( Test-Path ".\$name\src" ) { + rm -Recurse -Force ".\$name\src" } }