switch between arti and default
This commit is contained in:
34
frontend/switch-registry.ps1
Normal file
34
frontend/switch-registry.ps1
Normal 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"
|
||||
Reference in New Issue
Block a user