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 <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Nov 23, 2023
1 parent 26d525a commit 0356d93
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\": \"get-azure-pipelines-artifact\"/{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 0356d93

Please sign in to comment.