Automate build step (#1551)

* remove note that was fixed in #1526

* add build script

* add prepack script

* remove custom compilation steps
This commit is contained in:
Francisco Giordano
2018-12-12 15:36:00 -03:00
committed by GitHub
parent 7142e25e78
commit a99b9da3d4
3 changed files with 30 additions and 15 deletions

25
scripts/build.sh Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Configure to exit script as soon as a command fails.
set -o errexit
# Clean the existing build directory.
rm -rf build
# Create a temporary directory to place ignored files (e.g. examples).
tmp_dir="$(mktemp -dp.)"
# Move the ignored files to the temporary directory.
while IFS="" read -r ignored
do
mv "contracts/$ignored" "$tmp_dir"
done < contracts/.npmignore
# Compile everything else.
node_modules/.bin/truffle compile
# Return ignored files to their place.
mv "$tmp_dir/"* contracts/
# Delete the temporary directory.
rmdir "$tmp_dir"