Skip to content

Commit 12876f6

Browse files
anakinMangocanoo
andauthored
Apply suggestions from code review
Co-authored-by: Emi <[email protected]>
1 parent 813fc8f commit 12876f6

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ download_binary() {
7070
# Extract expected hash for this binary and verify
7171
local expected
7272
expected=$(grep "^${binary_name} " "$checksum_file" | awk '{print $1}')
73-
if [ -z "$expected" ]; then
73+
expected=$(grep "^${binary_name} " "$checksum_file" | awk '{print $1}')
7474
rm -f "$dest" "$checksum_file"
7575
fail "Checksum entry for $binary_name not found in checksums.txt"
7676
fi
@@ -81,7 +81,7 @@ download_binary() {
8181
elif command -v shasum &>/dev/null; then
8282
local expected
8383
expected=$(grep "^${binary_name} " "$checksum_file" | awk '{print $1}')
84-
if [ -z "$expected" ]; then
84+
expected=$(grep "^${binary_name} " "$checksum_file" | awk '{print $1}')
8585
rm -f "$dest" "$checksum_file"
8686
fail "Checksum entry for $binary_name not found in checksums.txt"
8787
fi
@@ -91,7 +91,8 @@ download_binary() {
9191
}
9292
else
9393
warn "Neither sha256sum nor shasum found — skipping checksum verification"
94-
fi
94+
rm -f "$dest" "$checksum_file"
95+
fail "Neither sha256sum nor shasum found — cannot verify binary integrity. Install coreutils and retry."
9596

9697
rm -f "$checksum_file"
9798
chmod +x "$dest"

0 commit comments

Comments
 (0)