Fix deployment of chaincode with higher version than 9 issue

This script fails if chaincode version is higher than 9 as 'grep' does not match ex. version equal to '10'

Signed-off-by: Titas <titas.petravicius@gmail.com>
This commit is contained in:
Titas 2020-07-15 11:35:03 +03:00 committed by Titas
parent 621a2c263e
commit 1b4ea4a013

View file

@ -185,7 +185,7 @@ queryCommitted() {
peer lifecycle chaincode querycommitted --channelID $CHANNEL_NAME --name fabcar >&log.txt
res=$?
set +x
test $res -eq 0 && VALUE=$(cat log.txt | grep -o '^Version: [0-9], Sequence: [0-9], Endorsement Plugin: escc, Validation Plugin: vscc')
test $res -eq 0 && VALUE=$(cat log.txt | grep -o '^Version: [0-9]\{1,\}, Sequence: [0-9]\{1,\}, Endorsement Plugin: escc, Validation Plugin: vscc')
test "$VALUE" = "$EXPECTED_RESULT" && let rc=0
COUNTER=$(expr $COUNTER + 1)
done