feat(lstv2 move): moved lstv2 into this app to keep them combined and easier to maintain
This commit is contained in:
35
lstV2/server/scripts/build.ps1
Normal file
35
lstV2/server/scripts/build.ps1
Normal file
@@ -0,0 +1,35 @@
|
||||
param (
|
||||
[string]$dir,
|
||||
[string]$app
|
||||
)
|
||||
# dir is the location of the root folder.
|
||||
|
||||
# Store the original directory
|
||||
$originalDir = Get-Location
|
||||
|
||||
Write-Host $originalDir
|
||||
|
||||
# Check if the directory is provided
|
||||
if (-not $dir) {
|
||||
Write-Host "Error: Directory parameter is required."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check if the directory exists
|
||||
if (-not (Test-Path $dir)) {
|
||||
Write-Host "Error: Directory '$dir' does not exist."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Navigate to the directory
|
||||
Set-Location -Path $dir
|
||||
|
||||
# Run npm run build
|
||||
Write-Host "Running 'npm run build' in directory: $dir"
|
||||
npm run build
|
||||
|
||||
Write-Host "Build completed successfully."
|
||||
|
||||
# Restore the original directory
|
||||
Set-Location -Path $originalDir
|
||||
exit 0
|
||||
Reference in New Issue
Block a user