From 08edf6a4292c03dd13b5bace32319197377003de Mon Sep 17 00:00:00 2001 From: Jordan Webb Date: Sun, 22 Jan 2023 16:53:01 -0600 Subject: [PATCH] Switch to Perl in update-starlark.sh --- scripts/update-starlark.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/update-starlark.sh b/scripts/update-starlark.sh index 0afbeaa..29fdbf1 100755 --- a/scripts/update-starlark.sh +++ b/scripts/update-starlark.sh @@ -13,14 +13,8 @@ if [ "$NEW_STARLARK_VERSION" = "$OLD_STARLARK_VERSION" ]; then exit 0 fi -# shellcheck disable=SC2260 -if sed --version 2&>/dev/null | grep -q GNU ; then - sed -i "s/$OLD_STARLARK_VERSION/$NEW_STARLARK_VERSION/g" README.md -else - sed -i .bak "s/$OLD_STARLARK_VERSION/$NEW_STARLARK_VERSION/g" README.md - rm -f README.md.bak || true -fi +perl -i -pe "s/\Q$OLD_STARLARK_VERSION\E/$NEW_STARLARK_VERSION/g" README.md -if [ -n "$GITHUB_ENV" ]; then +if [ -n "${GITHUB_ENV:-}" ]; then echo "NEW_STARLARK_VERSION=$NEW_STARLARK_VERSION" >> "$GITHUB_ENV" fi