diff --git a/scripts/devnet-allocs.sh b/scripts/devnet-allocs.sh index 873e2692..2d3d32d3 100755 --- a/scripts/devnet-allocs.sh +++ b/scripts/devnet-allocs.sh @@ -1,3 +1,5 @@ +#!/bin/bash + ## (1) Fetch monorepo binary at specific version used by Pessimism VERSION=$(cat go.mod | grep ethereum-optimism/optimism | awk '{print $2}' | sed 's/\/v//g') REPO_NAME=optimism-$(echo ${VERSION} | sed 's/v//g') @@ -16,28 +18,26 @@ echo "Version: ${VERSION}" cd optimism-${VERSION} ## (4) Install monorepo dependencies -{ - ## (4.a) Generate devnet allocations and persist them all into .devnet folder - echo "Initializing monorepo..." && - git submodule update --init --recursive && - make install-geth && - make devnet-allocs && - mv .devnet ../.devnet && - mv packages/contracts-bedrock/deploy-config/devnetL1.json ../.devnet/devnetL1.json - - STATUS = $? -} ; { - ## (4.b) Force cleanup of monorepo - echo "${STATUS} Cleaning up ${REPO_NAME} repo ..." && - cd ../ && - rm -rf ${REPO_NAME} - - if [ $? -eq 0 ] ; then - echo "Successfully cleaned up ${REPO_NAME} repo" - exit ${STATUS} - else - echo "Failed to clean up ${REPO_NAME} repo" - exit ${STATUS} - - fi -} +## (4.a) Generate devnet allocations and persist them all into .devnet folder +echo "Initializing monorepo..." +git submodule update --init --recursive && +make install-geth && +make devnet-allocs && +mv .devnet ../.devnet && +mv packages/contracts-bedrock/deploy-config/devnetL1.json ../.devnet/devnetL1.json + +STATUS=$? + +## (4.b) Force cleanup of monorepo +echo "${STATUS} Cleaning up ${REPO_NAME} repo ..." && +cd ../ && +rm -rf ${REPO_NAME} + +if [ $? -eq 0 ] ; then + echo "Successfully cleaned up ${REPO_NAME} repo" + exit ${STATUS} +else + echo "Failed to clean up ${REPO_NAME} repo" + exit ${STATUS} + +fi