Commit 3577f593 authored by refcell's avatar refcell

fix(scripts): foundry update reset local repo for commit installs

parent 05deae54
...@@ -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