Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush committed Aug 21, 2024
1 parent 22804b6 commit 7792adc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/sync-subnet-evm-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Add Remote
run: |
git remote add -f subnet-evm https://github.com/ava-labs/subnet-evm
git remote add subnet-evm https://github.com/ava-labs/subnet-evm
# TODO: Can use default when we remove the push trigger hack
# TODO: Replace test branch with actual (eg, coreth)
Expand Down
30 changes: 30 additions & 0 deletions scripts/apply_diff_and_rename.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Add other repo as a remote: `git remote add -f coreth [email protected]:ava-labs/coreth.git`.
# Usage: ./scripts/apply_diff_and_rename.sh coreth/master (or subnet-evm/master)

set -e;
set -u;

ROOT=$(git rev-parse --show-toplevel);
cd "${ROOT}";

BASE="${1}";

git diff .."${BASE}" --binary | git apply --whitespace=nowarn

if [[ "${BASE}" == coreth* ]]; then
echo "Replacing coreth with subnet-evm"
sed_command='s!github.com/ava-labs/coreth!github.com/ava-labs/subnet-evm!g'
else
echo "Replacing subnet-evm with coreth"
sed_command='s!github.com/ava-labs/subnet-evm!github.com/ava-labs/coreth!g'
fi

# TODO: improve this command that finds all the "coreth" references and replaces them with "subnet-evm"
LANG=C find . -type f \! -name 'apply_diff_and_rename.sh' \! -path './.git/*' \! -path './contracts/node_modules/*' -exec sed -i '' -e "${sed_command}" {} \;
gofmt -w .
go mod tidy

# Restore contracts/.gitignore
git checkout -- contracts/.gitignore

0 comments on commit 7792adc

Please sign in to comment.