feat: add shadcn admin workspace
This commit is contained in:
33
start-admin.ps1
Normal file
33
start-admin.ps1
Normal file
@@ -0,0 +1,33 @@
|
||||
param(
|
||||
[switch]$Install
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$repoRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$adminDir = Join-Path $repoRoot "admin"
|
||||
|
||||
if (-not (Test-Path $adminDir)) {
|
||||
throw "Admin directory not found: $adminDir"
|
||||
}
|
||||
|
||||
Push-Location $adminDir
|
||||
|
||||
try {
|
||||
if ($Install -or -not (Test-Path (Join-Path $adminDir "node_modules"))) {
|
||||
Write-Host "[admin] Installing dependencies..." -ForegroundColor Cyan
|
||||
npm install
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "npm install failed"
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "[admin] Starting Vite admin workspace..." -ForegroundColor Green
|
||||
npm run dev
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "npm run dev failed"
|
||||
}
|
||||
}
|
||||
finally {
|
||||
Pop-Location
|
||||
}
|
||||
Reference in New Issue
Block a user