diff --git a/.envrc-example b/.envrc-example index 4c92382679..2b44b9e3af 100644 --- a/.envrc-example +++ b/.envrc-example @@ -3,3 +3,5 @@ if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then fi use flake + +export POLKADOT_SDK_REPO=https://github.com/paritytech/polkadot-sdk.git diff --git a/scripts/init.sh b/scripts/init.sh index 8a02ccf677..779c6f5525 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -2,15 +2,20 @@ set -eux -echo "Checkout polkadot-sdk Snowfork fork" +echo "Checkout polkadot-sdk" pushd .. - if [ ! -d "polkadot-sdk" ]; then - git clone https://github.com/Snowfork/polkadot-sdk.git - cd snowbridge && ln -sf ../polkadot-sdk polkadot-sdk + if [[ -d ../polkadot-sdk ]] && (cd ../polkadot-sdk && git rev-parse --is-inside-work-tree) 2>&1 >/dev/nu + ls; then + echo "polkadot-sdk already exists" + else + repoURL="${POLKADOT_SDK_REPO:-https://github.com/paritytech/polkadot-sdk.git}" + + git clone "$repoURL" polkadot-sdk + + pushd polkadot-sdk + git pull origin master + popd fi - pushd polkadot-sdk - git fetch && git checkout snowbridge - popd popd echo "Checkout lodestar Snowfork fork" diff --git a/web/packages/test/scripts/build-binary.sh b/web/packages/test/scripts/build-binary.sh index e3a4eb2fa0..4009b37163 100755 --- a/web/packages/test/scripts/build-binary.sh +++ b/web/packages/test/scripts/build-binary.sh @@ -4,7 +4,8 @@ set -eu source scripts/set-env.sh build_binaries() { - pushd $root_dir/polkadot-sdk + pushd $root_dir + pushd $polkadot_sdk_dir local features='' if [ "$eth_network" == "localhost" ]; then @@ -33,6 +34,7 @@ build_binaries() { cp target/release/polkadot-parachain $output_bin_dir/polkadot-parachain popd + popd } changes_detected=0 diff --git a/web/packages/test/scripts/set-env.sh b/web/packages/test/scripts/set-env.sh index a63621c5e4..1ab1d6c278 100755 --- a/web/packages/test/scripts/set-env.sh +++ b/web/packages/test/scripts/set-env.sh @@ -10,6 +10,7 @@ export output_bin_dir="$output_dir/bin" ethereum_data_dir="$output_dir/ethereum" zombienet_data_dir="$output_dir/zombienet" export PATH="$output_bin_dir:$PATH" +export polkadot_sdk_dir="${POLKADOT_SDK_DIR:-../polkadot-sdk}" eth_network="${ETH_NETWORK:-localhost}" eth_endpoint_http="${ETH_RPC_ENDPOINT:-http://127.0.0.1:8545}/${INFURA_PROJECT_ID:-}"