Skip to content

Commit ef9ddfb

Browse files
committed
pre-push hook: detect need to update dist/ more robustly
The previous attempt only looked at the oneline of the tip commit. But that tip commit could have been a merge commit, too. Let's use a much better method: ask Git! While at it, let's mark the script as executable ;-) Signed-off-by: Johannes Schindelin <[email protected]>
1 parent bd7aac8 commit ef9ddfb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pre-push.hook

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ die 'The `pre-push` hook is not up to date with `pre-push.hook`'
1515
git diff --quiet dist/ ||
1616
die '`dist/` is dirty'
1717

18-
if test 'npm run build && npm run package' != "$(git show -s --format=%s HEAD)"
18+
base="$(git rev-list HEAD -1 -- dist/)"
19+
if test 0 -lt $(git rev-list --count ${base+$base..}HEAD -- \*.ts)
1920
then
2021
echo "Verifying that dist/ is up to date" >&2
2122
npm run build &&

0 commit comments

Comments
 (0)