Skip to content

Commit 3504c5b

Browse files
committed
update build script to try to always auth
1 parent 21ece26 commit 3504c5b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

build.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,7 @@ if (!$SkipBuild) {
195195
throw "Azure CLI not found"
196196
}
197197

198-
if ($null -ne $env:CARGO_REGISTRIES_POWERSHELL_TOKEN) {
199-
Write-Host "Using existing token"
200-
} else {
198+
if ($null -ne (Get-Command az -ErrorAction Ignore)) {
201199
Write-Host "Getting token"
202200
$accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
203201
if ($LASTEXITCODE -ne 0) {
@@ -208,6 +206,9 @@ if (!$SkipBuild) {
208206
$env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token'
209207
}
210208
}
209+
else {
210+
Write-Warning "Azure CLI not found, proceeding with anonymous access."
211+
}
211212
}
212213

213214
# make sure dependencies are built first so clippy runs correctly

0 commit comments

Comments
 (0)