Final sed fix
@@ -12,20 +12,24 @@ cp $IN_DIR/Franklin.sol $OUT_DIR/FranklinTest.sol
cp $IN_DIR/PriorityQueue.sol $OUT_DIR/PriorityQueueTest.sol
cp $IN_DIR/Verifier.sol $OUT_DIR/VerifierTest.sol
+sedi () {
+ sed --version >/dev/null 2>&1 && sed -i -- -E "$@" || sed -i "" -E "$@"
+}
+
# Rename contracts
-sed -e 's/Governance/GovernanceTest/' -i '' $OUT_DIR/*.sol
-sed -e 's/Franklin/FranklinTest/' -i '' $OUT_DIR/*.sol
-sed -e 's/PriorityQueue/PriorityQueueTest/' -i '' $OUT_DIR/*.sol
-sed -e 's/Verifier/VerifierTest/' -i '' $OUT_DIR/*.sol
+sedi 's/Governance/GovernanceTest/' $OUT_DIR/*.sol
+sedi 's/Franklin/FranklinTest/' $OUT_DIR/*.sol
+sedi 's/PriorityQueue/PriorityQueueTest/' $OUT_DIR/*.sol
+sedi 's/Verifier/VerifierTest/' $OUT_DIR/*.sol
# Workaround -> priority queue has FranklinTest in method names.
-sed -e 's/FranklinTest/Franklin/' -i '' $OUT_DIR/PriorityQueueTest.sol
+sedi 's/FranklinTest/Franklin/' $OUT_DIR/PriorityQueueTest.sol
# Changes solidity constant to provided value
# In solidity constant should be in the following form.
# $SOME_TYPE constant $NAME = $VALUE;
set_constant() {
- sed -E -e "s/(.*constant $1)(.*)\;/\1 = $2\;/" -i '' $3
+ sedi "s/(.*constant $1)(.*)\;/\1 = $2\;/" $3
}
# Change constants
