mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11162 from ethereum/macos-getversion
macOS get_version
This commit is contained in:
commit
f7271d4741
@ -26,6 +26,11 @@
|
||||
# (c) 2017 solidity contributors.
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
set -e
|
||||
set -eu
|
||||
|
||||
grep -oP "PROJECT_VERSION \"?\K[0-9.]+(?=\")?" "$(dirname "$0")/../CMakeLists.txt"
|
||||
version=$(sed -n -E -e 's/^\s*set\(PROJECT_VERSION "([0-9.]+)"\)\s*$/\1/p' "$(dirname "$0")/../CMakeLists.txt")
|
||||
|
||||
# Sanity check. Sed does not fail if it does not find a match or finds more than one.
|
||||
[[ $version =~ ^[0-9.]+$ ]] || { echo "Failed to find version in CMakeLists.txt"; exit 1; }
|
||||
|
||||
echo "$version"
|
||||
|
Loading…
Reference in New Issue
Block a user