Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@across-protocol/=node_modules/@across-protocol/
@ensdomains/=node_modules/@ensdomains/
@eth-optimism/=node_modules/@eth-optimism/
@gnosis.pm/=node_modules/@gnosis.pm/
@maticnetwork/=node_modules/@maticnetwork/
@matterlabs/=node_modules/@matterlabs/
@openzeppelin/=node_modules/@openzeppelin/
@scroll-tech/=node_modules/@scroll-tech/
@uma/=node_modules/@uma/
@uniswap/=node_modules/@uniswap/
arb-bridge-eth/=node_modules/arb-bridge-eth/
arb-bridge-peripherals/=node_modules/arb-bridge-peripherals/
arbos-precompiles/=node_modules/arbos-precompiles/
base64-sol/=node_modules/base64-sol/
eth-gas-reporter/=node_modules/eth-gas-reporter/
hardhat-deploy/=node_modules/hardhat-deploy/
hardhat/=node_modules/hardhat/
forge-std/=lib/forge-std/src/
19 changes: 19 additions & 0 deletions scripts/preCommitHook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,22 @@ if [ $EXTRACT_ADDRESSES_EXIT -ne 0 ]; then
echo "extract-addresses encountered an error. Aborting the hook."
exit $EXTRACT_ADDRESSES_EXIT
fi

# Check if foundry.toml was modified in staged changes and update remappings.txt if so
if git diff --cached --name-only --diff-filter=d | grep -q "foundry\.toml"; then
echo "Running forge remappings to update remappings.txt ..."
forge remappings > remappings.txt
FORGE_REMAPPINGS_EXIT=$?
if [ $FORGE_REMAPPINGS_EXIT -ne 0 ]; then
echo "forge remappings encountered an error. Aborting the hook."
exit $FORGE_REMAPPINGS_EXIT
fi

# Stage remappings.txt if it was modified
if git diff --name-only remappings.txt | grep -q "remappings.txt"; then
git add remappings.txt
echo "Updated and staged remappings.txt"
fi
else
echo "Skipping forge remappings (foundry.toml not modified)"
fi
Loading