Skip to content

Stop the tool install when an archive fails to extract (v2) - #231

Merged
ryanio merged 1 commit into
v2from
ryan/install-tools-extract-v2
Nov 10, 2026
Merged

ryanio merged 1 commit into
v2from
ryan/install-tools-extract-v2

Conversation

@ryanio

@ryanio ryanio commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes the issue Copilot found on seadrop#229 for v2, since #230 already merged.

scripts/install-tools.sh extracted archives with tar ... && mv .... Under set -e, bash ignores a failure on the left of &&, so if tar failed while updating an installed tool, the script kept the old binary, recorded the new checksum and reported success. Later runs then skipped the stale binary. The extraction and the move are now separate commands, so a failed extraction stops the install.

🤖 Generated with Claude Code

set -e ignores a failure on the left of &&, so a failed tar during an
update left the old binary in place, marked with the new checksum.
Run the extraction and the move as separate commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ryanio
ryanio requested a balanced review from Copilot November 10, 2026 21:36
@ryanio
ryanio merged commit 030ce5e into v2 Nov 10, 2026
6 checks passed
@ryanio
ryanio deleted the ryan/install-tools-extract-v2 branch November 10, 2026 21:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The review reports no active issues with the installer’s archive-extraction failure-handling change.

No open issues 🎉

What changed in this PR

Fixes archive-extraction failure handling in the v2 lint-tool installer, preventing stale binaries from being recorded as successfully updated.

Changes:

  • Separates extraction and move commands for .tar.gz and .tar.xz archives so set -e stops installation if extraction fails.
  • Adds a comment explaining why chaining these commands with && is unsafe.
File Description
scripts/​install-tools.sh Stops installation on archive-extraction failures before replacing binaries or recording checksums.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants