fix(cli): use PowerShell Expand-Archive for zip extraction on Windows - #21
Merged
olamide226 merged 1 commit intoFeb 27, 2026
Merged
Conversation
Windows built-in tar.exe (BSD tar) misinterprets the drive letter in a -C path (e.g. -C "C:\...") as a network hostname, causing extraction to fail with "tar: Cannot connect to C: resolve failed". On Windows, switch to PowerShell's Expand-Archive which handles Windows paths correctly. Non-Windows platforms continue to use tar as before. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes a Windows-specific bug in the CLI postinstall script where tar -xf with a -C path containing a drive letter fails because Windows' BSD tar misinterprets the drive letter as a network hostname. The fix detects Windows via the existing IS_WINDOWS constant and uses PowerShell's Expand-Archive cmdlet instead of tar for zip extraction on Windows systems.
Changes:
- Replace
tar -xfcommand with platform-specific extraction logic - Add Windows-specific PowerShell
Expand-Archivecommand for zip files - Maintain backward compatibility with tar for non-Windows platforms
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replace
tar -xfwith PowerShell'sExpand-Archivefor zip extraction on Windows in the CLI postinstall script.Why
Windows built-in
tar.exe(BSD tar) misinterprets the drive letter in a-Cpath (e.g.-C "C:\...") as a network hostname, causing extraction to fail with:The zip is downloaded successfully — only the extraction step breaks. This affects any Windows user installing
@rep-protocol/clivia pnpm/npm.Fix: detect
process.platform === 'win32'(via the existingIS_WINDOWSconstant) and use PowerShell'sExpand-Archiveon Windows. All other platforms continue to usetaras before.Type
fix— Bug fix (patch)