github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/integration/externalbuilders/binary/bin/build (about) 1 #!/bin/bash 2 3 # Copyright hechain. All Rights Reserved. 4 # 5 # SPDX-License-Identifier: Apache-2.0 6 7 set -euo pipefail 8 9 if [ "$#" -ne 3 ]; then 10 >&2 echo "Expected 3 directories got $#" 11 exit 1 12 fi 13 14 SRC="$1" 15 META="$2" 16 BLD="$3" 17 18 if [ -e "$SRC/metadata" ] ; then 19 cp -a "$SRC/metadata" "$BLD" 20 fi 21 22 if [ -f "$SRC/connection.json" ]; then 23 cp "$SRC/connection.json" "$BLD/connection.json" 24 else 25 cp "$(jq -r .path "$META/metadata.json")" "$BLD/chaincode" 26 fi