From 78e9286416237ae9239c694ebd4add78fb1f4bc0 Mon Sep 17 00:00:00 2001 From: rhysd Date: Fri, 23 Feb 2024 21:47:51 +0900 Subject: [PATCH] run `sed` once to replace all versions in a file --- scripts/bump-version.bash | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/bump-version.bash b/scripts/bump-version.bash index f3812bbf3..c89606b62 100755 --- a/scripts/bump-version.bash +++ b/scripts/bump-version.bash @@ -54,9 +54,11 @@ echo "Updating $pre_commit_hook" sed_ "s/entry: docker\\.io\\/rhysd\\/actionlint:.*/entry: docker.io\\/rhysd\\/actionlint:${version}/" "$pre_commit_hook" echo "Updating $usage_doc" -sed_ "s/ rev: v[0-9]+\.[0-9]+\.[0-9]+/ rev: v${version}/" "$usage_doc" -sed_ "s/actionlint@[0-9]+\.[0-9]+\.[0-9]+/actionlint@${version}/g" "$usage_doc" -sed_ "s/\`actionlint:[0-9]+\.[0-9]+\.[0-9]+\`/\`actionlint:${version}\`/g" "$usage_doc" +sed_ "\ + s/ rev: v[0-9]+\.[0-9]+\.[0-9]+/ rev: v${version}/; \ + s/actionlint@[0-9]+\.[0-9]+\.[0-9]+/actionlint@${version}/g; \ + s/\`actionlint:[0-9]+\.[0-9]+\.[0-9]+\`/\`actionlint:${version}\`/g; \ + " "$usage_doc" echo 'Creating a version bump commit and a version tag' git add "$pre_commit_hook" "$usage_doc"