Skip to content

Commit ccae476

Browse files
committed
Fix Windows cache path quoting
1 parent af6b23a commit ccae476

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

azure-pipelines.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,19 @@ jobs:
6464
addToPath: true
6565
architecture: $(PYTHON_ARCH)
6666

67-
- script: echo "##vso[task.setvariable variable=PIP_CACHE_DIR]$(HOME)/.cache/pip"
68-
condition: eq(variables['Agent.OS'], 'Linux')
69-
displayName: 'Set PIP_CACHE_DIR for Linux'
70-
71-
- script: echo "##vso[task.setvariable variable=PIP_CACHE_DIR]$(LocalAppData)\pip\Cache"
67+
- powershell: |
68+
$cachePath = Join-Path $env:LOCALAPPDATA "pip\Cache"
69+
if (!(Test-Path $cachePath)) { New-Item -ItemType Directory -Force -Path $cachePath }
70+
Write-Host "##vso[task.setvariable variable=PIP_CACHE_DIR]$cachePath"
71+
displayName: 'Set pip cache directory (Windows)'
7272
condition: eq(variables['Agent.OS'], 'Windows_NT')
73-
displayName: 'Set PIP_CACHE_DIR for Windows'
73+
74+
- bash: |
75+
CACHE_DIR="$HOME/.cache/pip"
76+
mkdir -p "$CACHE_DIR"
77+
echo "##vso[task.setvariable variable=PIP_CACHE_DIR]$CACHE_DIR"
78+
displayName: 'Set pip cache directory (Linux)'
79+
condition: eq(variables['Agent.OS'], 'Linux')
7480
7581
- task: Cache@2
7682
inputs:

0 commit comments

Comments
 (0)