Skip to content

Commit

Permalink
fix: make download solc script can run outside the protocol dir
Browse files Browse the repository at this point in the history
  • Loading branch information
alexshliu committed Mar 6, 2023
1 parent d735f80 commit c074599
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 c074599

Please sign in to comment.