From 7a23a9e7ae4b76047aaf9d52259982a62ec3b5d8 Mon Sep 17 00:00:00 2001 From: Michael Lohmann Date: Mon, 8 Jan 2024 11:18:33 +0100 Subject: [PATCH] redeem.nuggits: Fix spelling and rename flags => nuggits --- src/redeem.nuggit | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/redeem.nuggit b/src/redeem.nuggit index 601bfd0..e3e3352 100755 --- a/src/redeem.nuggit +++ b/src/redeem.nuggit @@ -19,13 +19,13 @@ else already_redeemed=0 git cat-file -e "$(echo "'$nuggit' already redeemed" | git hash-object --stdin)" 2>/dev/null && already_redeemed=1 - redeemed_flags="$(git rev-list --count nuggits)" - redeemed_flags=$((redeemed_flags - already_redeemed)) + redeemed_nuggits="$(git rev-list --count nuggits)" + redeemed_nuggits=$((redeemed_nuggits - already_redeemed)) - [ "$redeemed_flags" -ne $((NUMBER_OF_NUGGITS - 1 )) ] || git cat-file -p ALMOST_CREDITS_HASH; + [ "$redeemed_nuggits" -ne $((NUMBER_OF_NUGGITS - 1 )) ] || git cat-file -p ALMOST_CREDITS_HASH; - [ "$redeemed_flags" -ne $(( NUMBER_OF_NUGGITS + 0 )) ] || { - git cat-file -e "$(echo "# Redemed nuggits: $((NUMBER_OF_NUGGITS - 1))" | git hash-object --stdin)" 2>/dev/null || { echo Noughty boy!; exit 1; } + [ "$redeemed_nuggits" -ne $(( NUMBER_OF_NUGGITS + 0 )) ] || { + git cat-file -e "$(echo "# Redeemed nuggits: $((NUMBER_OF_NUGGITS - 1))" | git hash-object --stdin)" 2>/dev/null || { echo Noughty boy!; exit 1; } git cat-file -p CREDITS_HASH | tr 'A-Za-z' 'N-ZA-Mn-za-m'; } @@ -49,7 +49,7 @@ else } commit_nuggit "$nuggit" - echo "Number of redemed nuggits: $redeemed_flags" - echo "# Redemed nuggits: $redeemed_flags" | git hash-object --stdin -w >/dev/null 2>&1 + echo "Number of redeemed nuggits: $redeemed_nuggits" + echo "# Redeemed nuggits: $redeemed_nuggits" | git hash-object --stdin -w >/dev/null 2>&1 echo "'$nuggit' already redeemed" | git hash-object --stdin -w >/dev/null 2>&1 fi