From bd82d284066c820c3a7eef57970c38da4329bf1b Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Thu, 24 Oct 2024 01:13:01 -0700 Subject: [PATCH] Update program download script --- configs/scripts/program/dump.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configs/scripts/program/dump.sh b/configs/scripts/program/dump.sh index 68d85ee..eabff05 100755 --- a/configs/scripts/program/dump.sh +++ b/configs/scripts/program/dump.sh @@ -22,6 +22,7 @@ RPC_DEVNET="https://api.devnet.solana.com" if [ -z "$OUTPUT" ]; then echo "missing output directory" + cd ${CURRENT_DIR} exit 1 fi @@ -41,17 +42,20 @@ copy_from_chain() { "bin") solana account -u "$RPC" "$ACCOUNT_ID" -o ${OUTPUT}/$4$3 > /dev/null || { echo $(RED "[ ERROR ] Failed to dump program '$ACCOUNT_ID'") + cd ${CURRENT_DIR} exit 1 } ;; "so") - solana program dump -u "$RPC" "$ACCOUNT_ID" ${OUTPUT}/$4$3 > /dev/null|| { + solana program dump -u "$RPC" "$ACCOUNT_ID" ${OUTPUT}/$4$3 > /dev/null || { echo $(RED "[ ERROR ] Failed to dump program '$ACCOUNT_ID'") + cd ${CURRENT_DIR} exit 1 } ;; *) echo $(RED "[ ERROR ] unknown account type for '$3'") + cd ${CURRENT_DIR} exit 1 ;; esac