Skip to content

Stop the tool install when an archive fails to extract - #21

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

ryanio merged 1 commit into
mainfrom
ryan/install-tools-extract

Conversation

@ryanio

@ryanio ryanio commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Copilot found this in the copy of scripts/install-tools.sh on seadrop#229, and this repo has the same code.

The script 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>

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

No active review issues block the change to stop installation when archive extraction fails.

No open issues 🎉

What changed in this PR

Fixes the tool installer’s failure handling so unsuccessful archive extraction stops installation before a stale binary is marked as current.

Changes:

  • Separates extraction and move commands for .tar.gz and .tar.xz archives, allowing set -e to stop on extraction failures.
  • Adds a comment explaining why chaining these commands with && is unsafe.
File Description
scripts/​install-tools.sh Makes archive extraction failures halt installation before updating checksum markers.

Review effort: Balanced

@ryanio
ryanio merged commit 45fb0ce into main Nov 10, 2026
5 checks passed
@ryanio
ryanio deleted the ryan/install-tools-extract branch November 10, 2026 22:17
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.

3 participants