Skip to content

Commit 3987fa3

Browse files
azure-sdkhallipr
andauthored
Use test registry in npmrc for alpha packages (#36628)
Co-authored-by: Patrick Hallisey <[email protected]>
1 parent 8ecc5ab commit 3987fa3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

eng/common/scripts/TypeSpec-Project-Generate.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ function NpmInstallForProject([string]$workingDirectory) {
4545

4646
Write-Host("Copying package.json from $replacementPackageJson")
4747
Copy-Item -Path $replacementPackageJson -Destination "package.json" -Force
48+
49+
$useAlphaNpmRegistry = (Get-Content $replacementPackageJson -Raw).Contains("-alpha.")
50+
51+
if($useAlphaNpmRegistry) {
52+
Write-Host "Package.json contains '-alpha.' in the version, Creating .npmrc using public/azure-sdk-for-js-test-autorest feed."
53+
"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'
54+
}
55+
4856
npm install --no-lock-file
4957
if ($LASTEXITCODE) { exit $LASTEXITCODE }
5058
}

0 commit comments

Comments
 (0)