From b3f1531b2abf53b8e2676054fb3d7007c3d94d12 Mon Sep 17 00:00:00 2001 From: Sergio Oliveira Date: Thu, 12 Mar 2015 17:51:01 -0300 Subject: [PATCH] Make script work on Linux and Darwin --- update_obs.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/update_obs.sh b/update_obs.sh index 06b2795..1f6c8e9 100755 --- a/update_obs.sh +++ b/update_obs.sh @@ -1,8 +1,9 @@ #!/bin/bash -which -s osc || { echo "osc must be installed"; exit 1; } +which osc || { echo "osc must be installed"; exit 1; } VERSION=`python setup.py --version` +PLATFORM=`uname` pull_obs () { if [ -d .obs ] @@ -31,7 +32,12 @@ add_to_obs () { update_spec_versions () { - sed -i '' -E "s/(\%define (unmangled_)?version).*/\1 $VERSION/;" colab.spec + regex="s/(\%define (unmangled_)?version).*/\1 $VERSION/;" + if [[ "$PLATFORM" == 'Darwin' ]]; then + sed -i '' -E "$regex" colab.spec + else + sed -i -E "$regex" colab.spec + fi } -- libgit2 0.21.2