Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
add stash/reload feat
Browse files Browse the repository at this point in the history
  • Loading branch information
naszam committed Mar 8, 2023
1 parent b68131f commit 2114dc1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ make && spell_address=$(dapp create DssSpell)

./scripts/verify.py DssSpell "$spell_address"

# stash any changes in the staging area
(set -x; git stash)

# edit config.sol to add the deployed spell address
sed -Ei "s/($KEY_SPELL: *address\()(0x[[:xdigit:]]{40}|0x0|0)\)/\1$spell_address)/" "$SOURCE"

Expand All @@ -35,11 +38,16 @@ sed -i "s/\($KEY_BLOCK *: *\)[0-9]\+/\1$block/" "$SOURCE"
echo -e "${YELLOW}Network: $(cast chain)${NC}"
echo -e "${YELLOW}config.sol updated with ${PURPLE}deployed spell:${NC} $spell_address, ${PURPLE}timestamp:${NC} $timestamp and ${PURPLE}block:${NC} $block ${NC}"

# add script edit changes
git add -A

# reload the staging area with stashed changes
(set -x; git stash apply)

make test block="$block" || { echo -e "${PURPLE}Ensure Tests PASS before commiting the config.sol changes${NC}"; exit 1; }

# commit edit change to config.sol
if [[ $(git status --porcelain src/test/config.sol) ]]; then
(set -x; git add src/test/config.sol)
(set -x; git commit --edit)
else
echo -e "${PURPLE}Ensure config.sol was edited correctly${NC}"
Expand Down

0 comments on commit 2114dc1

Please sign in to comment.