storebytecode.sh: Allow BUILD_DIR outside of REPO_ROOT

This commit is contained in:
Kamil Śliwak 2020-11-20 14:56:12 +01:00
parent ae8f484ed4
commit 31a0a31c26

View File

@ -28,18 +28,14 @@
set -e set -e
REPO_ROOT="$(dirname "$0")"/../.. REPO_ROOT="$(dirname "$0")"/../..
cd "$REPO_ROOT"
REPO_ROOT=$(pwd) # make it absolute
if test -z "$1"; then BUILD_DIR="${1:-${REPO_ROOT}/build}"
BUILD_DIR="build"
else
BUILD_DIR="$1"
fi
echo "Compiling all test contracts into bytecode..." echo "Compiling all test contracts into bytecode..."
TMPDIR=$(mktemp -d) TMPDIR=$(mktemp -d)
( (
cd "$REPO_ROOT"
REPO_ROOT=$(pwd) # make it absolute
cd "$TMPDIR" cd "$TMPDIR"
"$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/test/ "$REPO_ROOT"/scripts/isolate_tests.py "$REPO_ROOT"/test/
@ -110,10 +106,10 @@ EOF
./solc *.sol > report.txt ./solc *.sol > report.txt
echo "Finished running the compiler." echo "Finished running the compiler."
else else
$REPO_ROOT/scripts/bytecodecompare/prepare_report.py $REPO_ROOT/$BUILD_DIR/solc/solc "$REPO_ROOT/scripts/bytecodecompare/prepare_report.py" "$BUILD_DIR/solc/solc"
fi fi
cp report.txt $REPO_ROOT cp report.txt "$REPO_ROOT"
) )
rm -rf "$TMPDIR" rm -rf "$TMPDIR"
echo "Storebytecode finished." echo "Storebytecode finished."