Skip to content

Commit e2ef50c

Browse files
committed
don't force auth if can't get token
1 parent 3504c5b commit e2ef50c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

build.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ if (!$SkipBuild) {
200200
$accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
201201
if ($LASTEXITCODE -ne 0) {
202202
Write-Warning "Failed to get access token, use 'az login' first, or use '-useCratesIO' to use crates.io. Proceeding with anonymous access."
203+
$env:CARGO_REGISITRIES_POWERSHELL_INDEX = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/"
203204
} else {
204205
$header = "Bearer $accessToken"
205206
$env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header
@@ -208,6 +209,7 @@ if (!$SkipBuild) {
208209
}
209210
else {
210211
Write-Warning "Azure CLI not found, proceeding with anonymous access."
212+
$env:CARGO_REGISITRIES_POWERSHELL_INDEX = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/"
211213
}
212214
}
213215

0 commit comments

Comments
 (0)