fabric-samples/asset-transfer-basic/chaincode-external/sampleBuilder/bin/detect
Aadithyan Raju 325b056e9d modified script calls
to enable multidestro support

Signed-off-by: Aadithyan Raju <93834376+AadithyanRaju@users.noreply.github.com>
2025-03-23 08:51:34 +00:00

14 lines
369 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
METADIR=$2
# check if the "type" field is set to "external"
# crude way without jq which is not in the default fabric peer image
TYPE=$(tr -d '\n' < "$METADIR/metadata.json" | awk -F':' '{ for (i = 1; i < NF; i++){ if ($i~/type/) { print $(i+1); break }}}'| cut -d\" -f2)
if [ "$TYPE" = "external" ]; then
exit 0
fi
exit 1