File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,17 @@ die () {
12
12
git diff --no-index --quiet pre-push.hook " $( git rev-parse --git-path hooks/pre-push) " ||
13
13
die ' The `pre-push` hook is not up to date with `pre-push.hook`'
14
14
15
+ # Verify that any tagged version is reflected in its `package.json`
16
+ for tag in $( git for-each-ref --format=' %(refname:short)' --points-at=HEAD ' refs/tags/v[0-9]*' )
17
+ do
18
+ git grep -q ' "version": "' " ${tag# v} " ' "' refs/tags/$tag -- package.json || {
19
+ sed ' s/\("version": "\)[^"]*/\1' " ${tag# v} " / < package.json > package.json.new &&
20
+ mv -f package.json.new package.json
21
+ die " package.json did not reflect $tag ; It was adjusted."
22
+ exit 1
23
+ }
24
+ done
25
+
15
26
git diff --quiet dist/ ||
16
27
die ' `dist/` is dirty'
17
28
You can’t perform that action at this time.
0 commit comments