Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit

Permalink
fix: scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Aug 28, 2024
1 parent 4dcdca0 commit 01e1909
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "etc/superchain-registry"]
path = etc/superchain-registry
url = https://github.com/ethereum-optimism/superchain-registry
4 changes: 4 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ default:
# Runs everything needed for ci
ci: fmt lint tests

# Generate file bindings for the superchain-registry
bind:
./scripts/bind.sh

# Run all tests
tests: test test-features test-docs

Expand Down
1 change: 1 addition & 0 deletions etc/superchain-registry
Submodule superchain-registry added at 8a8460
30 changes: 30 additions & 0 deletions scripts/bind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#! /bin/sh

REPO_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
REPO_ROOT="$(dirname "$REPO_ROOT")"
CHAINLIST_TOML="${REPO_ROOT}/etc/superchain-registry/chainList.toml"
CONFIGS_TOML="${REPO_ROOT}/etc/superchain-registry/bindings/rust-bindings/etc/configs.toml"
ALT_CONFIGS_TOML="${REPO_ROOT}/etc/superchain-registry/configs.toml"

# Attempt to copy over the chainList.toml file to crates/registry/etc/chainList.toml
if [ -f "${CHAINLIST_TOML}" ]; then
cp "${CHAINLIST_TOML}" "${REPO_ROOT}/crates/registry/etc/chainList.toml"
else
echo "[ERROR] ${CHAINLIST_TOML} does not exist"
exit 1
fi

# Attempt to copy over the configs.toml file to crates/registry/etc/configs.toml
if [ -f "${CONFIGS_TOML}" ]; then
cp "${CONFIGS_TOML}" "${REPO_ROOT}/crates/registry/etc/configs.toml"
else
echo "[WARN] ${CONFIGS_TOML} does not exist"
echo "[INFO] Attempting to copy configs.toml file from the repo root"
# Attempt to copy over the configs.toml file to crates/registry/etc/configs.toml
if [ -f "${ALT_CONFIGS_TOML}" ]; then
cp "${ALT_CONFIGS_TOML}" "${REPO_ROOT}/crates/registry/etc/configs.toml"
else
echo "[ERROR] ${ALT_CONFIGS_TOML} does not exist"
exit 1
fi
fi

0 comments on commit 01e1909

Please sign in to comment.