Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools repository for Tools P…
Browse files Browse the repository at this point in the history
…R 6758
  • Loading branch information
hallipr authored and azure-sdk committed Aug 11, 2023
1 parent 77508ce commit 29d456f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion eng/common/scripts/TypeSpec-Project-Generate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ param (
[ValidateNotNullOrEmpty()]
[string] $ProjectDirectory,
[string] $TypespecAdditionalOptions = $null, ## addtional typespec emitter options, separated by semicolon if more than one, e.g. option1=value1;option2=value2
[string] $NpmrcPath = $null, ## path to a preauthenticated .npmrc file to use for npm install
[switch] $SaveInputs = $false ## saves the temporary files during execution, default false
)

Expand Down Expand Up @@ -48,9 +49,14 @@ function NpmInstallForProject([string]$workingDirectory) {

$useAlphaNpmRegistry = (Get-Content $replacementPackageJson -Raw).Contains("-alpha.")

if($useAlphaNpmRegistry) {
if ($useAlphaNpmRegistry) {
if ($NpmrcPath) {
Copy-Item -Path $NpmrcPath -Destination ".npmrc" -Force
}
else {
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
Expand Down

0 comments on commit 29d456f

Please sign in to comment.