Skip to content

Commit

Permalink
fix(protocol): make download solc script can run outside the protocol…
Browse files Browse the repository at this point in the history
… dir (#13263)
  • Loading branch information
alexshliu authored Mar 7, 2023
1 parent 4e78865 commit 7cd7787
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/protocol/scripts/download_solc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

set -e

mkdir -p bin && cd bin
protocol_dir=$(realpath "$(dirname $0)/..")
solc_bin=${protocol_dir}/bin/solc

if [ -f "solc" ]; then
if [ -f "${solc_bin}" ]; then
exit 0
fi

mkdir -p "$(dirname ${solc_bin})"

VERSION=v0.8.18

if [ "$(uname)" = 'Darwin' ]; then
Expand All @@ -19,6 +22,6 @@ else
exit 1
fi

wget -O solc https://github.com/ethereum/solidity/releases/download/$VERSION/$SOLC_FILE_NAME
wget -O "${solc_bin}" https://github.com/ethereum/solidity/releases/download/$VERSION/$SOLC_FILE_NAME

chmod +x solc
chmod +x "${solc_bin}"

0 comments on commit 7cd7787

Please sign in to comment.