Skip to content

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

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

The tool installer’s archive-extraction error-handling change has no active review issues.

No open issues 🎉

What changed in this PR

Fixes archive extraction error handling in the tool installer so failed extraction stops the script instead of recording a new checksum for a stale binary.

Changes:

  • Separates extraction and move commands for .tar.gz and .tar.xz archives so set -e catches extraction failures.
  • Adds a comment explaining why the commands must remain separate.
File Description
scripts/​install-tools.sh Makes archive extraction failures stop tool installation.

Review effort: Balanced

@ryanio
ryanio merged commit 15f1713 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.

2 participants