switch between arti and default

This commit is contained in:
pratik
2025-10-15 14:28:38 -05:00
parent b8cabbe0c8
commit 56dcc04ad7
13 changed files with 749 additions and 8 deletions

View File

@@ -0,0 +1,34 @@
[CmdletBinding()]
param(
[Parameter(Position=0)]
[ValidateSet("public", "artifactory")]
[string]$RegistryType = "public"
)
$ErrorActionPreference = "Stop"
switch ($RegistryType) {
"public" {
Write-Host "Switching to public npm registry..." -ForegroundColor Yellow
Copy-Item ".npmrc.public" ".npmrc" -Force
Write-Host "[OK] Now using registry.npmjs.org" -ForegroundColor Green
Write-Host ""
Write-Host "To install dependencies:" -ForegroundColor White
Write-Host " npm ci --force" -ForegroundColor Cyan
}
"artifactory" {
Write-Host "Switching to Artifactory registry..." -ForegroundColor Yellow
Copy-Item ".npmrc.artifactory" ".npmrc" -Force
Write-Host "[OK] Now using Artifactory registry" -ForegroundColor Green
Write-Host ""
Write-Host "Make sure to set environment variables if authentication is required:" -ForegroundColor White
Write-Host ' $env:ARTIFACTORY_AUTH_TOKEN = "your_token"' -ForegroundColor Cyan
Write-Host ""
Write-Host "To install dependencies:" -ForegroundColor White
Write-Host " npm ci --force" -ForegroundColor Cyan
}
}
Write-Host ""
Write-Host "Current .npmrc contents:" -ForegroundColor White
Get-Content ".npmrc"