File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
cardano_node_tests/cluster_scripts/testnets Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ TESTNET_DIR="${1:?"Testnet dir needed"}"
77SCRIPT_DIR=" $( readlink -m " ${0%/* } " ) "
88SOCKET_PATH=" $( readlink -m " $CARDANO_NODE_SOCKET_PATH " ) "
99STATE_CLUSTER=" ${SOCKET_PATH%/* } "
10+ # Fail if PWD is STATE_CLUSTER, as STATE_CLUSTER will be deleted
11+ if [ " $PWD " = " $STATE_CLUSTER " ]; then
12+ echo " Please run this script from outside of '$STATE_CLUSTER '" >&2
13+ exit 1
14+ fi
1015STATE_CLUSTER_NAME=" ${STATE_CLUSTER##*/ } "
1116SUPERVISORD_SOCKET_PATH=" ${STATE_CLUSTER} /supervisord.sock"
1217START_CLUSTER_LOG=" ${STATE_CLUSTER} /start-cluster.log"
@@ -31,7 +36,10 @@ if [ -e "$SCRIPT_DIR/shell_env" ]; then
3136 source " $SCRIPT_DIR /shell_env"
3237fi
3338
34- rm -rf " $STATE_CLUSTER "
39+ if ! ( rm -rf " $STATE_CLUSTER " || rm -rf " $STATE_CLUSTER " ; ); then
40+ echo " Could not remove existing '$STATE_CLUSTER '" >&2
41+ exit 1
42+ fi
3543mkdir -p " $STATE_CLUSTER " /{byron,shelley,webserver}
3644cd " $STATE_CLUSTER /.."
3745
You can’t perform that action at this time.
0 commit comments