Skip to content

Commit 47369e4

Browse files
committed
feat: added env var -z checks and removed unnecesarry rm file
1 parent a2b040c commit 47369e4

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

contracts/scripts/upgrade_aligned_contracts.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ if [ -z "$MULTISIG" ]; then
44
echo "Missing MULTISIG env variable"
55
exit 1
66
fi
7+
if [ -z "$OUTPUT_PATH" ]; then
8+
echo "Missing OUTPUT_PATH env variable"
9+
exit 1
10+
fi
11+
if [ -z "$EXISTING_DEPLOYMENT_INFO_PATH" ]; then
12+
echo "Missing EXISTING_DEPLOYMENT_INFO_PATH env variable"
13+
exit 1
14+
fi
15+
if [ -z "$RPC_URL" ]; then
16+
echo "Missing RPC_URL env variable"
17+
exit 1
18+
fi
19+
if [ -z "$PRIVATE_KEY" ]; then
20+
echo "Missing PRIVATE_KEY env variable"
21+
exit 1
22+
fi
723

824
# cd to the directory of this script so that this can be run from anywhere
925
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
@@ -35,9 +51,6 @@ jq --arg new_aligned_layer_service_manager_implementation "$new_aligned_layer_se
3551
# Replace the original file with the temporary file
3652
mv "script/output/holesky/alignedlayer_deployment_output.temp.json" $OUTPUT_PATH
3753

38-
# Delete the temporary file
39-
rm -f "script/output/holesky/alignedlayer_deployment_output.temp.json"
40-
4154
data=$(cast calldata "upgrade(address, address)" $aligned_layer_service_manager $new_aligned_layer_service_manager_implementation)
4255

4356
if [ "$MULTISIG" = false ]; then

0 commit comments

Comments
 (0)