From f838d6b5a810a9e90525f3b4f1d8f3c10b8cb5db Mon Sep 17 00:00:00 2001 From: Parameswaran Selvam Date: Wed, 14 Dec 2022 14:01:10 +0530 Subject: [PATCH] added a check for prereq into deploycc script (#884) Signed-off-by: Parameswaran Selvam Signed-off-by: Parameswaran Selvam --- test-network/scripts/deployCC.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test-network/scripts/deployCC.sh b/test-network/scripts/deployCC.sh index 9f151aa9..7dbfa67f 100755 --- a/test-network/scripts/deployCC.sh +++ b/test-network/scripts/deployCC.sh @@ -122,6 +122,21 @@ packageChaincode() { successln "Chaincode is packaged" } +function checkPrereqs() { + jq --version > /dev/null 2>&1 + + if [[ $? -ne 0 ]]; then + errorln "jq command not found..." + errorln + errorln "Follow the instructions in the Fabric docs to install the prereqs" + errorln "https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html" + exit 1 + fi +} + +#check for prerequisites +checkPrereqs + ## package the chaincode packageChaincode