diff --git a/scripts/build_contracts.sh b/scripts/build_contracts.sh index 4ce4d3a2b6..8ed389b82c 100755 --- a/scripts/build_contracts.sh +++ b/scripts/build_contracts.sh @@ -1,16 +1,44 @@ #!/bin/bash -CURRENT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" -PARENT_DIR="$( builtin cd ${CURRENT_DIR}/.. >/dev/null 2>&1 ; pwd -P )" -cd ${PARENT_DIR} +set -e # Exit on error +# Determine the current script directory +CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Determine the parent directory +PARENT_DIR="$( dirname "$CURRENT_DIR" )" + +# Move to the parent directory +cd "$PARENT_DIR" + +# Install Go packages in tools/schema +echo "Installing Go packages in tools/schema..." cd tools/schema go install -cd ${PARENT_DIR} +# Move back to the parent directory +cd "$PARENT_DIR" + +# Run 'make install' +echo "Running 'make install'..." make install + +# Move to contracts/wasm/scripts +echo "Moving to contracts/wasm/scripts..." cd contracts/wasm/scripts + +# Run cleanup.sh +echo "Running cleanup.sh..." ./cleanup.sh + +# Run all_build.sh +echo "Running all_build.sh..." ./all_build.sh + +# Run update_hardcoded.sh +echo "Running update_hardcoded.sh..." ./update_hardcoded.sh -cd ${CURRENT_DIR} +# Move back to the original script directory +cd "$CURRENT_DIR" + +echo "Script completed successfully."