Files
Hua.Abp.Demo/etc/scripts/initialize-solution.ps1
T
2025-12-29 00:41:26 +08:00

50 lines
1.3 KiB
PowerShell

$scriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
$jobs = @()
$jobs += Start-Job -Name "InstallLibs" -ScriptBlock {
$ErrorActionPreference = "Stop"
Set-Location (Join-Path $using:scriptRoot "../../")
abp install-libs
if ($LASTEXITCODE -ne 0) {
throw "abp install-libs exited with code $LASTEXITCODE"
}
}
$jobs += Start-Job -Name "DbMigrator" -ScriptBlock {
$ErrorActionPreference = "Stop"
Set-Location (Join-Path $using:scriptRoot "../../src/Hua.Abp.Demo.DbMigrator")
dotnet run
if ($LASTEXITCODE -ne 0) {
throw "dotnet run (DbMigrator) exited with code $LASTEXITCODE"
}
}
$jobs += Start-Job -Name "DevCert" -ScriptBlock {
$ErrorActionPreference = "Stop"
Set-Location (Join-Path $using:scriptRoot "../../src/Hua.Abp.Demo.HttpApi.Host")
dotnet dev-certs https -v -ep openiddict.pfx -p a8dad6bd-08cf-40f9-baaf-873686b50b75
if ($LASTEXITCODE -ne 0) {
throw "dotnet dev-certs exited with code $LASTEXITCODE"
}
}
Wait-Job $jobs | Out-Null
$failed = $jobs | Where-Object { $_.State -eq 'Failed' }
$hasError = $failed.Count -gt 0
if ($hasError) {
foreach ($job in $failed) {
[Console]::Error.WriteLine("Job '$($job.Name)' FAILED")
}
Remove-Job $jobs | Out-Null
exit -1
}
Remove-Job $jobs | Out-Null
exit 0