fix(build): add --force-local flag to tar on Windows (#303)

On Windows, paths like D:\path are misinterpreted by tar as remote
host:path syntax (Unix tar convention). Adding --force-local tells
tar to treat colons as part of the filename, fixing the extraction
failure in GitHub Actions Windows builds.

Error was: "tar (child): Cannot connect to D: resolve failed"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Andy
2025-12-26 13:55:47 +01:00
committed by GitHub
parent 937a60f8bd
commit d0b0b3df0d
+9 -1
View File
@@ -255,8 +255,16 @@ function extractTarGz(archivePath, destDir) {
// Ensure destination exists
fs.mkdirSync(destDir, { recursive: true });
// Build tar arguments
// On Windows, paths like D:\path are misinterpreted as remote host:path
// --force-local tells tar to treat colons as part of the filename
const tarArgs = ['-xzf', archivePath, '-C', destDir];
if (os.platform() === 'win32') {
tarArgs.unshift('--force-local');
}
// Use tar command with array arguments (safer than string interpolation)
const result = spawnSync('tar', ['-xzf', archivePath, '-C', destDir], {
const result = spawnSync('tar', tarArgs, {
stdio: 'inherit',
});