Skip to content

Commit

Permalink
support relative config file dir
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenzung committed Dec 12, 2024
1 parent 131d3e7 commit ef2542e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/tokamak/contracts-bedrock/scripts/start-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -32,15 +34,22 @@ 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)
echo "ChainID: $chainID"

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
Expand Down

0 comments on commit ef2542e

Please sign in to comment.