mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Make network.sh more tolerant (#634)
The network.sh is dependent onbeing executed from the test-network directory This PR makes it a little more tolerant, and will add a bin directgory based on the location of the script - not just the PWD Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
This commit is contained in:
parent
35be8f7425
commit
b50611575b
1 changed files with 11 additions and 2 deletions
|
|
@ -12,10 +12,20 @@
|
|||
#
|
||||
# prepending $PWD/../bin to PATH to ensure we are picking up the correct binaries
|
||||
# this may be commented out to resolve installed version of tools if desired
|
||||
export PATH=${PWD}/../bin:$PATH
|
||||
#
|
||||
# However using PWD in the path has the side effect that location that
|
||||
# this script is run from is critical. To ease this, get the directory
|
||||
# this script is actually in and infer location from there. (putting first)
|
||||
|
||||
ROOTDIR=$(cd "$(dirname "$0")" && pwd)
|
||||
export PATH=${ROOTDIR}/../bin:${PWD}/../bin:$PATH
|
||||
export FABRIC_CFG_PATH=${PWD}/configtx
|
||||
export VERBOSE=false
|
||||
|
||||
# push to the required directory & set a trap to go back if needed
|
||||
pushd ${ROOTDIR} > /dev/null
|
||||
trap "popd > /dev/null" EXIT
|
||||
|
||||
. scripts/utils.sh
|
||||
|
||||
# Obtain CONTAINER_IDS and remove them
|
||||
|
|
@ -483,4 +493,3 @@ else
|
|||
printHelp
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue