Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Commit

Permalink
handle trailing zero correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffgrunewald committed Jun 9, 2022
1 parent f9549ec commit e2206e3
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions tag-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ dep_hash() {
git show "${MINER}:rebar.lock" | grep -A2 "${DEP}" | sed -e "s/.*\"\(.*\)\".*/\1/" | tr '\n' ' ' | awk '{print $3}'
}

strip_zeros() {
local VZN=$(echo $1 | sed -e 's/0//g')

if [[ $VZN == "" ]]; then
echo "0"
else
echo $VZN
fi
}

val_tag() {
local VAL_VERSION
local MAJ
Expand All @@ -34,7 +24,7 @@ val_tag() {
MIN=$(echo $VAL_VERSION | awk '{print substr( $0, 4, 3 )}')
PATCH=$(echo $VAL_VERSION | awk '{print substr( $0, 7, 4 )}')

echo "validator$(strip_zeros $MAJ).$(strip_zeros $MIN).$(strip_zeros $PATCH)"
echo "validator$((10#$MAJ)).$((10#$MIN)).$((10#$PATCH))"
}

declare -r repos="blockchain libp2p sibyl ecc508 relcast dkg hbbft helium_proto"
Expand Down

0 comments on commit e2206e3

Please sign in to comment.