Better regex for finding version pragmas and replace it with >=0.0

There is a bug which stops ^0 from working.
This commit is contained in:
Alex Beregszaszi 2018-09-17 17:38:01 +01:00
parent 321ab08102
commit c9f468b717
2 changed files with 2 additions and 2 deletions

View File

@ -178,7 +178,7 @@ do
echo " - $dir"
cd "$dir"
# Replace version pragmas
find . -name '*.sol' -type f -print0 | xargs -0 sed -i -e 's/pragma solidity [^;]+/pragma solidity ^0/'
find . -name '*.sol' -type f -print0 | xargs -0 sed -i -e 's/pragma solidity [\^0-9\.]*/pragma solidity >=0.0/'
compileFull -w *.sol */*.sol
cd ..
fi

View File

@ -59,7 +59,7 @@ function test_truffle
if [ "$name" == "Zeppelin" -o "$name" == "Gnosis" ]; then
echo "Replaced fixed-version pragmas..."
# Replace fixed-version pragmas in Gnosis (part of Consensys best practice)
find contracts test -name '*.sol' -type f -print0 | xargs -0 sed -i -e 's/pragma solidity [^;]+/pragma solidity ^0/'
find contracts test -name '*.sol' -type f -print0 | xargs -0 sed -i -e 's/pragma solidity [\^0-9\.]*/pragma solidity >=0.0/'
fi
assertsol="node_modules/truffle/build/Assert.sol"
if [ -f "$assertsol" ]