Skip to content

Commit c6a96f7

Browse files
committed
derive nuget feed uri in script
1 parent db1e91b commit c6a96f7

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tools/Configure-PrivateNpmFeed.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,18 @@ Write-Host "Created $rootNpmrc"
3535
$rushNpmrc = Join-Path $SourcesDirectory "autorest.powershell/common/config/rush/.npmrc"
3636
Set-Content -Path $rushNpmrc -Value $npmrcContent -NoNewline
3737
Write-Host "Updated $rushNpmrc"
38+
39+
# Create NuGet.config to redirect dotnet restore to the private feed
40+
$nugetFeed = $Registry -replace "/npm/registry/$", "/nuget/v3/index.json"
41+
$nugetConfig = @"
42+
<?xml version="1.0" encoding="utf-8"?>
43+
<configuration>
44+
<packageSources>
45+
<clear />
46+
<add key="PowerShell_V2_Build" value="$nugetFeed" />
47+
</packageSources>
48+
</configuration>
49+
"@
50+
$nugetConfigPath = Join-Path $SourcesDirectory "NuGet.config"
51+
Set-Content -Path $nugetConfigPath -Value $nugetConfig -NoNewline
52+
Write-Host "Created $nugetConfigPath"

0 commit comments

Comments
 (0)