chore(update): drop no-op checksum sed#18
Open
CheapFuck wants to merge 1 commit into
Open
Conversation
The checksum verification piped the .sha256 through
`sed "s/${tarball}$/${tarball}/"` before `sha256sum -c`. That substitution
replaces the filename with itself, so it never changes anything — the
accompanying comment ("rewrite it") describes behavior the code doesn't have.
The release checksum is generated by `.releaserc.yml` with
`sha256sum "towel-<ver>.tar.gz"`, which writes a bare filename in the standard
two-space format. Since the tarball is downloaded under that same bare name into
$tmpdir and verification runs from there, `sha256sum -c "$checksum"` matches the
local file directly.
Remove the no-op sed and its misleading comment, verifying the downloaded
tarball directly. No behavior change; less dead code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
In
towel update --apply, the checksum verification piped the.sha256through asedbeforesha256sum -c:The substitution
s/${tarball}$/${tarball}/replaces the filename with itself, so it never changes anything. The comment claims it rewrites the filename column, but the code is a no-op.Why it's safe to drop
The release checksum is produced in
.releaserc.ymlwith:sha256sum "towel-${nextRelease.version}.tar.gz" > "towel-${nextRelease.version}.tar.gz.sha256"That writes a bare filename in the standard two-space format (
<hash> towel-<ver>.tar.gz). The tarball is downloaded under that same bare name into$tmpdir, and verification runs aftercd "$tmpdir", sosha256sum -c "$checksum"matches the local file directly — no rewriting needed.Change
No behavior change; removes dead code and a misleading comment.
Verification
sha256sum -c <file>.sha256verifies a release-format checksum directly (confirmed locally).shellcheck -xandshfmt -dpass oninstall,towel, and alltowel-*scripts.