Browse files

Use expr instead of bash-specific regex.

  • Loading branch information...
1 parent b78b48b commit 4be3584b86687ddc04461478268d1affff0dfcff @naaman naaman committed May 31, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 bin/common
View
6 bin/common
@@ -45,11 +45,11 @@ _has_playConfig() {
get_supported_sbt_version() {
local ctxDir=$1
if _has_buildPropertiesFile $ctxDir; then
- local sbtVersion=$(\
- grep -P '[ \t]*sbt\.version[ \t]*=' ${ctxDir}/project/build.properties | \
+ sbtVersionLine="$(grep -P '[ \t]*sbt\.version[ \t]*=' "${ctxDir}"/project/build.properties)"
+ sbtVersion=$(echo "$sbtVersionLine" |
sed -E -e 's/[ \t]*sbt\.version[ \t]*=[ \t]*(0\.11\.[0-3])[ \t\n\r]*/\1/'
)
- if [[ "$sbtVersion" =~ 0\.11\.[0-3]$ ]] ; then
+ if [ $(expr "$sbtVersion" : "0\.11\.[0-3]$") != 0 ] ; then
echo "$sbtVersion"
else
echo ""

0 comments on commit 4be3584

Please sign in to comment.