update ci
[awesomized/libmemcached] / .builds / scripts / notify-gitter
index f16c2fe48c418219a0505f209783eb3bc42878dd..cac46b7598a0f6797ffc8ad1f169f6cbd40e0eb0 100755 (executable)
@@ -5,17 +5,22 @@ GITTER=$(cat ~/.gitter)
 STATUS=$1
 
 REPO=m6w6/libmemcached
-REF=$(git describe --abbrev --always libmemcached)
+REF=$(GIT_DIR=libmemcached/.git git describe --abbrev --always)
 REF_URL=https://github.com/${REPO}/commits/${REF}
 
 BUILD_URL=${JOB_URL}
-BUILD_TAG=$(uname -o)
-if test "$BUILD_TAG" = "GNU/Linux"
+BUILD_TAG=$(uname -o 2>/dev/null || uname -s)
+if expr match "$BUILD_TAG" ".*Linux" >/dev/null
 then
        BUILD_TAG=$(lsb_release -irs)
 fi
 BUILD_CXX=$(c++ --version | head -1)
-BUILD_ENV=${BUILD_TAG}/${BUILD_CXX}
+if expr match "${BUILD_CXX}" "${BUILD_TAG}" >/dev/null
+then
+       BUILD_ENV="${BUILD_CXX}"
+else
+       BUILD_ENV="${BUILD_TAG}/${BUILD_CXX}"
+fi
 
 case "$STATUS" in
 success)