From 9c2c0222cca268143c558bc8f45399ffef773371 Mon Sep 17 00:00:00 2001 From: Malte Kraus Date: Thu, 12 Sep 2024 11:25:02 +0200 Subject: [PATCH] update flatgraph also make updateDependencies.sh compatible with non-GNU sed variants --- build.sbt | 2 +- updateDependencies.sh | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 0bb9bfe39..4756cd411 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,7 @@ name := "codepropertygraph" // parsed by project/Versions.scala, updated by updateDependencies.sh -val flatgraphVersion = "0.0.87" +val flatgraphVersion = "0.0.88" inThisBuild( List( diff --git a/updateDependencies.sh b/updateDependencies.sh index f5c02c42b..f0f988f7b 100755 --- a/updateDependencies.sh +++ b/updateDependencies.sh @@ -9,6 +9,16 @@ check_installed() { fi } +function sedi() { + if sed --version 2> /dev/null | grep -q 'GNU' ; then + # GNU sed does not like a second argument for -i + sed -i "$@" + else + # but macOS (FreeBSD) sed needs it + sed -i '' "$@" + fi +} + check_installed curl # check if xmllint is installed @@ -57,13 +67,13 @@ function update { if [ "$NON_INTERACTIVE_OPTION" == "--non-interactive" ] then echo "non-interactive mode, auto-updating $NAME: $OLD_VERSION -> $VERSION" - sed -i "s/$SEARCH/$REPLACE/" build.sbt + sedi "s/$SEARCH/$REPLACE/" build.sbt else echo "update $NAME: $OLD_VERSION -> $VERSION? [Y/n]" read ANSWER if [ -z $ANSWER ] || [ "y" == $ANSWER ] || [ "Y" == $ANSWER ] then - sed -i "s/$SEARCH/$REPLACE/" build.sbt + sedi "s/$SEARCH/$REPLACE/" build.sbt fi fi fi