From e3d86beab232c5f4051609781f6f6db7b15c13a6 Mon Sep 17 00:00:00 2001 From: Pedro Pombeiro Date: Mon, 11 Jun 2018 14:53:37 +0200 Subject: [PATCH] Fix script so that it works with GNU `sed` Signed-off-by: Pedro Pombeiro --- scripts/update-status-go.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/update-status-go.sh b/scripts/update-status-go.sh index 3ae25b1e2e..345d3133a7 100755 --- a/scripts/update-status-go.sh +++ b/scripts/update-status-go.sh @@ -11,6 +11,10 @@ usage() { printf " %s develop-g12345678\n" "$(basename "$0")" } +sedi () { + sed --version >/dev/null 2>&1 && sed -i -- "$@" || sed -i "" "$@" +} + if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then usage exit 1 @@ -23,5 +27,5 @@ fi STATUSGO_VERSION=$1 -sed -i '' -e "s/\(\).*\(<\/version>\)/\1$STATUSGO_VERSION\2/" modules/react-native-status/ios/RCTStatus/pom.xml -sed -i '' -e "s/\(statusGoVersion = '\).*\('\)/\1$STATUSGO_VERSION\2/" modules/react-native-status/android/build.gradle +sedi "s/\(\).*\(<\/version>\)/\1$STATUSGO_VERSION\2/" modules/react-native-status/ios/RCTStatus/pom.xml +sedi "s/\(statusGoVersion = '\).*\('\)/\1$STATUSGO_VERSION\2/" modules/react-native-status/android/build.gradle