Skip to content

Commit 9cf2ea1

Browse files
authored
refactor: return instead of exit (#208)
1 parent 5f843bf commit 9cf2ea1

11 files changed

+19
-19
lines changed

script/avs-signing-key.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SERVICE_INDEX=${SERVICE_INDEX:-0}
77
SERVICE_ID=`curl -s http://localhost:8000/app | jq -r ".services[${SERVICE_INDEX}].id"`
88
if [ -z "$SERVICE_ID" ] || [ "$SERVICE_ID" == "null" ]; then
99
echo "Error: SERVICE_ID is null or not found for index ${SERVICE_INDEX}."
10-
exit 1
10+
return
1111
fi
1212

1313
HD_INDEX=`curl -s http://localhost:8000/service-key/${SERVICE_ID} | jq -rc '.secp256k1.hd_index'`

script/build-service.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if [ -z "$WAVS_SERVICE_MANAGER_ADDRESS" ]; then
3434
export WAVS_SERVICE_MANAGER_ADDRESS=$(jq -r .addresses.WavsServiceManager ./.nodes/avs_deploy.json)
3535
if [ -z "$WAVS_SERVICE_MANAGER_ADDRESS" ]; then
3636
echo "WAVS_SERVICE_MANAGER_ADDRESS is not set. Please set it to the address of the service manager."
37-
exit 1
37+
return
3838
fi
3939
fi
4040

script/create-aggregator.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fi
2020

2121
SP=""; if [[ "$(uname)" == *"Darwin"* ]]; then SP=" "; fi
2222

23-
cd $(git rev-parse --show-toplevel) || exit 1
23+
cd $(git rev-parse --show-toplevel) || return
2424

2525
mkdir -p .docker
2626

@@ -43,7 +43,7 @@ sed -i${SP}'' -e "s/.%%MNEMONIC_REFERENCE%%$/ $AGG_MNEMONIC/" ${ENV_FILENAME}
4343

4444
cat > "${AGG_LOC}/start.sh" << EOF
4545
#!/bin/bash
46-
cd \$(dirname "\$0") || exit 1
46+
cd \$(dirname "\$0") || return
4747
4848
IMAGE=ghcr.io/lay3rlabs/wavs:35c96a4
4949
INSTANCE=wavs-aggregator-${AGGREGATOR_INDEX}

script/create-deployer.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if [ ! -f .env ]; then
1515
cp .env.example .env
1616
if [ $? -ne 0 ]; then
1717
echo "Failed to copy .env.example to .env"
18-
exit 1
18+
return
1919
fi
2020
fi
2121

script/create-operator.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
SP=""; if [[ "$(uname)" == *"Darwin"* ]]; then SP=" "; fi
44

5-
cd $(git rev-parse --show-toplevel) || exit 1
5+
cd $(git rev-parse --show-toplevel) || return
66

77
mkdir -p .docker
88

99
# require a number input as argument 1, if not, require OPERATOR_INDEX env variable
1010
export OPERATOR_INDEX=${OPERATOR_INDEX:-$1}
1111
if [ -z "$OPERATOR_INDEX" ]; then
1212
echo "Please provide an operator index as the first argument or set OPERATOR_INDEX environment variable."
13-
exit 1
13+
return
1414
fi
1515

1616
OPERATOR_LOC=infra/wavs-${OPERATOR_INDEX}
@@ -26,7 +26,7 @@ if [ -d "${OPERATOR_LOC}" ] && [ "$(ls -A ${OPERATOR_LOC})" ]; then
2626
sudo rm -rf ${OPERATOR_LOC}
2727
else
2828
echo -e "\nExiting without changes."
29-
exit 1
29+
return
3030
fi
3131
fi
3232

@@ -52,7 +52,7 @@ rm ${TEMP_FILENAME}
5252
# Create startup script
5353
cat > "${OPERATOR_LOC}/start.sh" << EOF
5454
#!/bin/bash
55-
cd \$(dirname "\$0") || exit 1
55+
cd \$(dirname "\$0") || return
5656
5757
IMAGE=ghcr.io/lay3rlabs/wavs:35c96a4
5858
WAVS_INSTANCE=wavs-${OPERATOR_INDEX}

script/get-deploy-status.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if [ ! -f .env ]; then
66
cp .env.example .env
77
if [ $? -ne 0 ]; then
88
echo "Failed to copy .env.example to .env"
9-
exit 1
9+
return
1010
fi
1111
fi
1212

script/get-ipfs-gateway.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ elif [ "$DEPLOY_ENV" = "TESTNET" ]; then
1010
IPFS_GATEWAY=https://gateway.pinata.cloud/ipfs/
1111
else
1212
echo "Unknown DEPLOY_ENV: $DEPLOY_ENV"
13-
exit 1
13+
return
1414
fi
1515

1616
echo "${IPFS_GATEWAY}"

script/get-registry.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ elif [ "$DEPLOY_ENV" = "TESTNET" ]; then
1010
REGISTRY=wa.dev
1111
else
1212
echo "Unknown DEPLOY_ENV: $DEPLOY_ENV"
13-
exit 1
13+
return
1414
fi
1515

1616
echo "${REGISTRY}"

script/get-rpc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ elif [ "$DEPLOY_ENV" = "TESTNET" ]; then
1010
RPC_URL=$(grep "^TESTNET_RPC_URL=" .env)
1111
else
1212
echo "Unknown DEPLOY_ENV: $DEPLOY_ENV"
13-
exit 1
13+
return
1414
fi
1515

1616
echo "${RPC_URL}" | cut -d '=' -f2

script/get-wasi-namespace.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
if [ -z "$REGISTRY" ]; then
4-
echo "REGISTRY is not set. Please set the REGISTRY environment variable." && exit 1
4+
echo "REGISTRY is not set. Please set the REGISTRY environment variable." && return
55
fi
66

77
# ===

0 commit comments

Comments
 (0)