Commit d9a1e1cf authored by clabby's avatar clabby Committed by GitHub

Merge pull request #8403 from ethereum-optimism/refcell/foundry-update-fix

feat: Fix Foundry Update to reset Git Repo
parents 581b7a17 3577f593
...@@ -8,6 +8,18 @@ SHA=$(cat ./.foundryrc) ...@@ -8,6 +8,18 @@ SHA=$(cat ./.foundryrc)
# Check if there is a nightly tag corresponding to the `.foundryrc` commit hash # Check if there is a nightly tag corresponding to the `.foundryrc` commit hash
TAG="nightly-$SHA" TAG="nightly-$SHA"
# If the foundry repository exists and a branch is checked out, we need to abort
# any changes inside ~/.foundry/foundry-rs/foundry. This is because foundryup will
# attempt to pull the latest changes from the remote repository, which will fail
# if there are any uncommitted changes.
if [ -d ~/.foundry/foundry-rs/foundry ]; then
echo "Foundry repository exists! Aborting any changes..."
cd ~/.foundry/foundry-rs/foundry
git reset --hard
git clean -fd
cd -
fi
# Create a temporary directory # Create a temporary directory
TMP_DIR=$(mktemp -d) TMP_DIR=$(mktemp -d)
echo "Created tempdir @ $TMP_DIR" echo "Created tempdir @ $TMP_DIR"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment