revert npm changes

This commit is contained in:
pratik
2025-10-15 16:15:03 -05:00
parent 2c7c5a1a97
commit cb6b867b58
5 changed files with 26 additions and 41 deletions

View File

@@ -18,8 +18,8 @@ if ($Help) {
Write-Host " -Help Show this help message" -ForegroundColor White
Write-Host ""
Write-Host "NPM Registry:" -ForegroundColor Yellow
Write-Host " Create frontend/.npmrc to configure custom npm registry" -ForegroundColor White
Write-Host " The Docker build will use this file if present" -ForegroundColor White
Write-Host " Uses your machine's npm configuration automatically" -ForegroundColor White
Write-Host " npm install runs on host before Docker build" -ForegroundColor White
Write-Host ""
Write-Host "Brings up the complete stack: database, backend API, and frontend" -ForegroundColor Green
Write-Host ""
@@ -31,24 +31,19 @@ Write-Host "Obsidian - Quick Start" -ForegroundColor Cyan
Write-Host "=========================================" -ForegroundColor Cyan
Write-Host ""
# Copy user's .npmrc to frontend directory if it exists and frontend/.npmrc doesn't
# Copy user's .npmrc to frontend directory if it exists
$UserNpmrc = Join-Path $env:USERPROFILE ".npmrc"
$FrontendNpmrc = "frontend\.npmrc"
if (Test-Path $UserNpmrc) {
if (-not (Test-Path $FrontendNpmrc)) {
Write-Host "[INFO] Copying npm registry config from $UserNpmrc" -ForegroundColor Yellow
Copy-Item $UserNpmrc $FrontendNpmrc
Write-Host "[OK] Using custom npm registry configuration" -ForegroundColor Green
} else {
Write-Host "[OK] Using existing frontend\.npmrc" -ForegroundColor Green
}
Write-Host "Copying npm registry config for Docker build..." -ForegroundColor Yellow
Copy-Item $UserNpmrc $FrontendNpmrc -Force
Write-Host "[OK] Using custom npm registry configuration" -ForegroundColor Green
} else {
if (Test-Path $FrontendNpmrc) {
Write-Host "[OK] Using frontend\.npmrc" -ForegroundColor Green
} else {
Write-Host "[INFO] Using default npm registry (no .npmrc found)" -ForegroundColor Yellow
Remove-Item $FrontendNpmrc -Force
}
Write-Host "[INFO] Using default npm registry" -ForegroundColor Yellow
}
Write-Host ""