Skip to content

Commit

Permalink
update flatgraph (#1785)
Browse files Browse the repository at this point in the history
also make updateDependencies.sh compatible with non-GNU sed variants
  • Loading branch information
maltek authored Sep 12, 2024
1 parent af84a5e commit 8f975f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
14 changes: 12 additions & 2 deletions updateDependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8f975f8

Please sign in to comment.