Skip to content

Commit 2357a31

Browse files
authored
Improve build script error detection and remove redundant file (#2921)
Update the build script to check $LASTEXITCODE after each npm command, ensuring that failures during installation, linting, or building are correctly reported. Additionally, remove the unused build.ps1 script in the ServicePulse directory.
1 parent 1c5e15a commit 2357a31

2 files changed

Lines changed: 8 additions & 20 deletions

File tree

src/ServicePulse.Host/build.ps1

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,21 @@ if (Test-Path $AppOutputFolder) {
77
}
88

99
New-Item -ItemType Directory -Force -Path $AppOutputFolder
10-
1110
Push-Location $FrontendSourceFolder
12-
npm audit --audit-level=low --omit=dev
1311

14-
if ( $? -eq $false ) {
15-
exit $LastExitCode
16-
}
12+
npm audit --audit-level=low --omit=dev
13+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
1714

1815
npm install
16+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
17+
1918
npm run lint
19+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
20+
2021
npm run build
22+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
23+
2124
Remove-Item -Path "./dist/mockServiceWorker.js" -ErrorAction SilentlyContinue
2225
Pop-Location
2326

2427
Copy-Item -path $FrontendSourceFolder/dist/* -Destination $AppOutputFolder -Recurse
25-
26-
if ( $? -eq $false ) {
27-
exit $LastExitCode
28-
}

src/ServicePulse/build.ps1

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)