Skip to content

Commit

Permalink
pre-push hook: adjust all _three_ locations of the version
Browse files Browse the repository at this point in the history
When a new version is tagged, we need to take care not only of two
locations, but of three...

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Dec 15, 2023
1 parent 3f87f76 commit 6f14b09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pre-push.hook
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ do
echo 'warning: HEAD is not up to date with `origin/main`' >&2

regex="^ \"version\": \"$(echo "${tag#v}" | sed 's/\./\\./g')\",\$"
substitute="s/^\\( \"version\": \"\\).*\",\$/\\1${tag#v}\",/"
substitute="/\"name\": \"setup-git-for-windows-sdk\"/{N;s/\\(\"version\": \"\\).*\",\$/\\1${tag#v}\",/}"
git grep -q "$regex" refs/tags/$tag -- package.json || {
sed "$substitute" <package.json >package.json.new &&
mv -f package.json.new package.json
Expand Down

0 comments on commit 6f14b09

Please sign in to comment.