Skip to content

Commit

Permalink
Strip out whitespace chars with sed and use expr to match the version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Naaman Newbold committed May 31, 2012
1 parent 4be3584 commit df24e6b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions bin/common
Expand Up @@ -45,11 +45,9 @@ _has_playConfig() {
get_supported_sbt_version() { get_supported_sbt_version() {
local ctxDir=$1 local ctxDir=$1
if _has_buildPropertiesFile $ctxDir; then if _has_buildPropertiesFile $ctxDir; then
sbtVersionLine="$(grep -P '[ \t]*sbt\.version[ \t]*=' "${ctxDir}"/project/build.properties)" sbtVersionLine="$(grep -P '[ \t]*sbt\.version[ \t]*=' "${ctxDir}"/project/build.properties | sed -E -e 's/[ \t\r\n]//g')"
sbtVersion=$(echo "$sbtVersionLine" | sbtVersion=$(expr "$sbtVersionLine" : 'sbt\.version=\(0\.11\.[0-3]\)$')
sed -E -e 's/[ \t]*sbt\.version[ \t]*=[ \t]*(0\.11\.[0-3])[ \t\n\r]*/\1/' if [ "$sbtVersion" != 0 ] ; then
)
if [ $(expr "$sbtVersion" : "0\.11\.[0-3]$") != 0 ] ; then
echo "$sbtVersion" echo "$sbtVersion"
else else
echo "" echo ""
Expand Down

0 comments on commit df24e6b

Please sign in to comment.