File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3+ scratch=$( mktemp -d -t tmp.XXXXXXXXXX)
4+ function finish() {
5+ rm -rf " $scratch "
6+ }
7+ trap finish EXIT
8+
39set -ex
410
511cd " $( dirname " ${BASH_SOURCE[0]} " ) " /..
612
713get_latest () {
14+ git fetch --tags
15+
816 git tag |
917 # drop `v` prefix
1018 grep " ^v" |
@@ -22,10 +30,10 @@ get_latest() {
2230
2331latest=" $( get_latest) "
2432
25- git grep --line-number " # LATEST" examples > want.txt
26- git grep --line-number " \" $latest \" # LATEST" examples > got.txt
33+ git grep --line-number " # LATEST" examples > " $scratch / want.txt" || true
34+ git grep --line-number " \" $latest \" # LATEST" examples > " $scratch / got.txt" || true
2735
28- if ! git diff --no-index --exit-code want.txt got.txt; then
36+ if ! git diff --no-index --exit-code " $scratch / want.txt" " $scratch / got.txt" ; then
2937 echo " "
3038 echo " ❌ Detected old versions! Make sure that all versions \` version = \" ...\" # LATEST\` match the latest git tag: $latest "
3139 exit 1
You can’t perform that action at this time.
0 commit comments