Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Perl in update-starlark.sh #137

Merged
merged 1 commit into from
Jan 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions scripts/update-starlark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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