File tree Expand file tree Collapse file tree 2 files changed +30
-32
lines changed Expand file tree Collapse file tree 2 files changed +30
-32
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ echo " Pruning tags before looking for tags to delete..."
4
+ git fetch --prune --prune-tags
5
+
6
+ PATTERN=" @7\.\d\+\.\d\+-pre"
7
+
8
+ TAGS=$( git tag | grep -e " ${PATTERN} " )
9
+
10
+ if [[ $TAGS == " " ]]; then
11
+ echo " No tags to delete, exiting"
12
+ exit 0
13
+ fi
14
+
15
+ # Delay setting this because if it's set when no tags exist the program exits
16
+ # on the TAGS assignment above
17
+ set -e
18
+
19
+ NUM_TAGS=$( git tag | grep -e " ${PATTERN} " | wc -l | sed ' s/ //g' )
20
+ TAGS_LINE=$( git tag | grep -e " ${PATTERN} " | tr ' \n' ' ' )
21
+
22
+ echo " "
23
+ echo " Found ${NUM_TAGS} tags to delete. To delete, run the following commands:"
24
+ echo " "
25
+ echo " git push origin --delete ${TAGS_LINE} "
26
+ echo " git fetch --prune --prune-tags"
27
+
28
+ set +e
Original file line number Diff line number Diff line change @@ -40,40 +40,10 @@ git push
40
40
git branch -d release-next
41
41
42
42
if [[ -n $( git show-ref refs/heads/changeset-release/release-next) ]]; then
43
- git branch -d changeset-release/release-next
43
+ git branch -D changeset-release/release-next
44
44
fi
45
45
46
- # If this is set when no tags exist the program exits on the TAGS assignment
47
- set +e
48
-
49
- echo " Pruning tags before looking for tags to delete:"
50
- git fetch --prune --prune-tags
51
-
52
- PATTERN=" @7\.\d\+\.\d\+-pre"
53
-
54
- # Don't keep around prerelease tags for all packages - only the `react-router` package
55
- TAGS=$( git tag | grep -e " ${PATTERN} " | grep -ve " ^react-router@" )
56
-
57
- if [[ $TAGS == " " ]]; then
58
- echo " No tags to delete, exiting"
59
- exit 0
60
- fi
61
-
62
- set -e
63
-
64
- NUM_TAGS=$( git tag | grep -e " ${PATTERN} " | grep -ve " ^react-router@" | wc -l | sed ' s/ //g' )
65
- TAGS_LINE=$( git tag | grep -e " ${PATTERN} " | grep -ve " ^react-router@" | tr ' \n' ' ' )
66
-
67
- echo " Found ${NUM_TAGS} tags to delete: ${TAGS_LINE} "
68
-
69
- echo " To delete, run the following commands:"
70
- echo " "
71
- echo " git push origin --delete ${TAGS_LINE} "
72
- echo " git fetch --prune --prune-tags"
73
-
74
- set +e
75
- set +x
76
-
46
+ ./scripts/delete-pre-tags.sh
77
47
78
48
set +e
79
49
set +x
You can’t perform that action at this time.
0 commit comments