Skip to content

Commit a73b845

Browse files
cd-bitwardenclaude
andcommitted
Fix Windows CLI build: Add -Force to directory creation
The "Get pkg-fetch" step was failing because New-Item throws an error if the directory already exists. This can happen with GitHub Actions runner caching or when retrying failed jobs. Added -Force parameter to New-Item commands to handle existing directories gracefully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent b3b6df8 commit a73b845

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/build-cli.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ jobs:
337337
run: |
338338
cd $HOME
339339
$fetchedUrl = "https://github.com/yao-pkg/pkg-fetch/releases/download/v$env:_WIN_PKG_VERSION/node-v$env:_WIN_PKG_FETCH_VERSION-win-x64"
340-
New-Item -ItemType directory -Path .\.pkg-cache
341-
New-Item -ItemType directory -Path .\.pkg-cache\v$env:_WIN_PKG_VERSION
340+
New-Item -ItemType directory -Path .\.pkg-cache -Force
341+
New-Item -ItemType directory -Path .\.pkg-cache\v$env:_WIN_PKG_VERSION -Force
342342
Invoke-RestMethod -Uri $fetchedUrl `
343343
-OutFile ".\.pkg-cache\v$env:_WIN_PKG_VERSION\fetched-v$env:_WIN_PKG_FETCH_VERSION-win-x64"
344344

0 commit comments

Comments
 (0)