The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hyperlane-monorepo/solidity/bytecodeversion.sh

17 lines
408 B

#!/bin/sh
FILEPATH="contracts/PackageVersioned.sol"
TEMPFILE=$(mktemp)
# writes all but the last 2 lines to the temp file
head -n $(($(wc -l < $FILEPATH) - 2)) $FILEPATH > $TEMPFILE
# writes generated last 2 lines to the temp file
cat <<EOF >> $TEMPFILE
string public constant PACKAGE_VERSION = "$npm_package_version";
}
EOF
# overwrite the original file with the temp file
cat $TEMPFILE > $FILEPATH