fix: address copilot review comments
- Anchor grep pattern to prevent partial filename matches - Add helpful installation instructions for missing checksum tools
- commit
- d6ffbc4829d5d2d86f1eb6d98e45317c627eac84
- author
- brice · · 2026-01-17 07:58 UTC
- parent
- dea7072
- signature
- unsigned
1 file · +8 -2
M install.sh +8 -2
| @@ -65,7 +65,7 @@ fi | |||
| 65 | 65 | ||
| 66 | 66 | # Verify checksum | |
| 67 | 67 | echo "Verifying checksum..." | |
| 68 | - | EXPECTED_CHECKSUM=$(grep "${TARBALL}" "$TMP_DIR/checksums.txt" | awk '{print $1}') | |
| 68 | + | EXPECTED_CHECKSUM=$(grep -E "[[:space:]]${TARBALL}\$" "$TMP_DIR/checksums.txt" | awk '{print $1}') | |
| 69 | 69 | if [ -z "$EXPECTED_CHECKSUM" ]; then | |
| 70 | 70 | echo "Error: Could not find checksum for ${TARBALL} in checksums.txt" | |
| 71 | 71 | exit 1 | |
| @@ -77,7 +77,13 @@ if command -v sha256sum >/dev/null 2>&1; then | |||
| 77 | 77 | elif command -v shasum >/dev/null 2>&1; then | |
| 78 | 78 | ACTUAL_CHECKSUM=$(shasum -a 256 "$TMP_DIR/$TARBALL" | awk '{print $1}') | |
| 79 | 79 | else | |
| 80 | - | echo "Error: Neither sha256sum nor shasum found. Cannot verify checksum." | |
| 80 | + | echo "Error: Neither 'sha256sum' nor 'shasum' was found. Cannot verify checksum." | |
| 81 | + | echo "" | |
| 82 | + | echo "Please install one of these tools:" | |
| 83 | + | echo " Debian/Ubuntu: sudo apt-get install coreutils" | |
| 84 | + | echo " Fedora/RHEL: sudo dnf install coreutils" | |
| 85 | + | echo " Alpine: apk add coreutils" | |
| 86 | + | echo " macOS: shasum should be pre-installed" | |
| 81 | 87 | exit 1 | |
| 82 | 88 | fi | |
| 83 | 89 | ||
| @@ -65,7 +65,7 @@ fi | |||||
| 65 | 65 | ||||
| 66 | # Verify checksum | 66 | # Verify checksum | ||
| 67 | echo "Verifying checksum..." | 67 | echo "Verifying checksum..." | ||
| 68 | - | EXPECTED_CHECKSUM=$(grep "${TARBALL}" "$TMP_DIR/checksums.txt" | awk '{print $1}') | 68 | + | EXPECTED_CHECKSUM=$(grep -E "[[:space:]]${TARBALL}\$" "$TMP_DIR/checksums.txt" | awk '{print $1}') |
| 69 | if [ -z "$EXPECTED_CHECKSUM" ]; then | 69 | if [ -z "$EXPECTED_CHECKSUM" ]; then | ||
| 70 | echo "Error: Could not find checksum for ${TARBALL} in checksums.txt" | 70 | echo "Error: Could not find checksum for ${TARBALL} in checksums.txt" | ||
| 71 | exit 1 | 71 | exit 1 | ||
| @@ -77,7 +77,13 @@ if command -v sha256sum >/dev/null 2>&1; then | |||||
| 77 | elif command -v shasum >/dev/null 2>&1; then | 77 | elif command -v shasum >/dev/null 2>&1; then | ||
| 78 | ACTUAL_CHECKSUM=$(shasum -a 256 "$TMP_DIR/$TARBALL" | awk '{print $1}') | 78 | ACTUAL_CHECKSUM=$(shasum -a 256 "$TMP_DIR/$TARBALL" | awk '{print $1}') | ||
| 79 | else | 79 | else | ||
| 80 | - | echo "Error: Neither sha256sum nor shasum found. Cannot verify checksum." | 80 | + | echo "Error: Neither 'sha256sum' nor 'shasum' was found. Cannot verify checksum." |
| 81 | + | echo "" | |||
| 82 | + | echo "Please install one of these tools:" | |||
| 83 | + | echo " Debian/Ubuntu: sudo apt-get install coreutils" | |||
| 84 | + | echo " Fedora/RHEL: sudo dnf install coreutils" | |||
| 85 | + | echo " Alpine: apk add coreutils" | |||
| 86 | + | echo " macOS: shasum should be pre-installed" | |||
| 81 | exit 1 | 87 | exit 1 | ||
| 82 | fi | 88 | fi | ||
| 83 | 89 | ||||