Skip to content

Commit fb758c3

Browse files
committed
ensure deps downloaded
1 parent cf46f0e commit fb758c3

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎.azure-pipelines/common-templates/install-tools.yml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,22 @@ steps:
7575
workingDir: $(Build.SourcesDirectory)
7676
customCommand: install -g @autorest/core@3.10.4 --registry https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/PowerShell_V2_Build/npm/registry/
7777

78+
- task: PowerShell@2
79+
displayName: Pre-populate autorest core cache
80+
inputs:
81+
targetType: inline
82+
pwsh: true
83+
script: |
84+
# Autorest looks for @autorest/core in ~/.autorest/@autorest/core/<version>/node_modules/
85+
# Pre-installing it here with the explicit registry flag means autorest never needs
86+
# to make any npm calls during module generation.
87+
$cacheDir = Join-Path $env:USERPROFILE ".autorest\@autorest\core\3.10.4"
88+
New-Item -ItemType Directory -Force -Path $cacheDir | Out-Null
89+
Write-Host "Pre-installing @autorest/core@3.10.4 into autorest cache: $cacheDir"
90+
npm install @autorest/core@3.10.4 --prefix $cacheDir --registry https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/PowerShell_V2_Build/npm/registry/
91+
if ($LASTEXITCODE -ne 0) { throw "Failed to pre-install @autorest/core@3.10.4 into autorest cache (exit $LASTEXITCODE)" }
92+
Write-Host "Autorest core cache pre-populated successfully"
93+
7894
- task: Npm@1
7995
displayName: Install Rush
8096
inputs:

0 commit comments

Comments
 (0)