Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions scripts/soak/external-tools.mts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,13 @@ async function installAssetTool(name: string, pin: ToolPin): Promise<void> {
let binName = pin.binaryName ?? name
const destDir = path.join(RACK_DIR, name, pin.version!)
let destBin = path.join(destDir, binName)
// Windows archives land as `<bin>.exe`; resolve the same suffix the
// post-extract path does so a second --install is a no-op instead of a
// forced re-download (which wedges on a restricted/offline runner).
if (!existsSync(destBin) && existsSync(`${destBin}.exe`)) {
destBin = `${destBin}.exe`
binName = `${binName}.exe`
}
Comment on lines +284 to +290

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Restrict .exe resolution to Windows.

This branch is described as Windows-specific, but it currently runs on every platform. If a non-Windows installation has <destBin>.exe alongside the expected binary, the installer will reuse it and change the linked command name unexpectedly. Add process.platform === 'win32' here and apply the same guard to the post-extraction check at Lines 301-306 (or extract both checks into one helper) to keep first and repeated installs consistent.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/soak/external-tools.mts` around lines 284 - 290, Restrict the `.exe`
fallback in the installer’s destination resolution to `process.platform ===
'win32'`, so non-Windows platforms never reuse or rename an adjacent executable.
Apply the same Windows guard to the post-extraction check around the
corresponding destination and command-name updates, keeping first and repeated
installs consistent.

if (existsSync(destBin)) {
linkHandle(destBin, binName)
console.log(`[external-tools] ${name}@${pin.version} already installed`)
Expand Down
Loading