Skip to content

Commit 74b4fa1

Browse files
committed
Apply shellcheck suggestions
1 parent c801348 commit 74b4fa1

File tree

1 file changed

+3
-1
lines changed
  • overlays/turnkey.d/github-latest-release/usr/local/bin

1 file changed

+3
-1
lines changed

overlays/turnkey.d/github-latest-release/usr/local/bin/gh_releases

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ get_page() {
8989
page=$3
9090
tmp_file=$(mktemp $tmp_dir/XXXX.tmp)
9191
curl "$USER" -b /tmp/cookies.txt -c /tmp/cookies.txt -s "${url}?page=${page}&per_page=100" > "$tmp_file" 2>/dev/null || true
92-
if grep '"message"' "$tmp_file"; then
92+
if grep "Bad credentials" "$tmp_file" >/dev/null ; then
93+
fatal "Bad GitHub credentials"
94+
elif grep '"message"' "$tmp_file"; then
9395
fatal "$repo_path: $(sed -En '\|message|s|^.*: "(.*)",$|\1|p' "$tmp_file")"
9496
else
9597
grep -oP "\"$key\": \"\\K(.*)(?=\")" "$tmp_file"

0 commit comments

Comments
 (0)