From ef2542ef205db8d3380f400a946d7f9fbb55196a Mon Sep 17 00:00:00 2001 From: nguyenzung Date: Thu, 12 Dec 2024 23:32:34 +0700 Subject: [PATCH] support relative config file dir --- .../contracts-bedrock/scripts/start-deploy.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/tokamak/contracts-bedrock/scripts/start-deploy.sh b/packages/tokamak/contracts-bedrock/scripts/start-deploy.sh index bc2608d44..d898fec4e 100755 --- a/packages/tokamak/contracts-bedrock/scripts/start-deploy.sh +++ b/packages/tokamak/contracts-bedrock/scripts/start-deploy.sh @@ -5,10 +5,12 @@ environement= chainID= deployResultFile= + OPTSTRING=":c:e:" projectRoot=`pwd | sed 's%\(.*/tokamak-thanos\)/.*%\1%'` currentPWD=$(pwd) +configDir=$projectRoot/packages/tomamak/contracts-bedrock/temp-deploy-config handleScriptInput() { echo "Check script input" @@ -32,7 +34,14 @@ handleScriptInput() { esac done - export DEPLOY_CONFIG_PATH=$configFilePath + if [ ! -d "$configDir" ]; then + mkdir -p "$configDir" + echo " Temp config directory '$configDir' created." + fi + + cp $configFilePath $configDir/config.json + export DEPLOY_CONFIG_PATH=${configDir}/config.json + source $environement export chainID=$(jq '.l1ChainID' $configFilePath) @@ -40,7 +49,7 @@ handleScriptInput() { echo "Project root: $projectRoot" echo "Current dir: $currentPWD" - echo "Config file path: $configFilePath" + echo "Config file path: $DEPLOY_CONFIG_PATH" echo "Env file: $environment" # checkScriptInput