Use test registry in npmrc for alpha packages (#4666)

Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>
This commit is contained in:
Azure SDK Bot 2023-05-30 14:58:50 -07:00 committed by GitHub
parent 822063c838
commit b9d83aa5b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,14 @@ function NpmInstallForProject([string]$workingDirectory) {
Write-Host("Copying package.json from $replacementPackageJson")
Copy-Item -Path $replacementPackageJson -Destination "package.json" -Force
$useAlphaNpmRegistry = (Get-Content $replacementPackageJson -Raw).Contains("-alpha.")
if($useAlphaNpmRegistry) {
Write-Host "Package.json contains '-alpha.' in the version, Creating .npmrc using public/azure-sdk-for-js-test-autorest feed."
"registry=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry/ `n`nalways-auth=true" | Out-File '.npmrc'
}
npm install --no-lock-file
if ($LASTEXITCODE) { exit $LASTEXITCODE }
}