Skip to content

Commit a6b2d9a

Browse files
committed
more strict regex
1 parent c590d90 commit a6b2d9a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

generate-book.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ add_badge() {
66
TITLE=${1:-PR}
77
TYPE=${2:-pull}
88
SHIELD_IO_TYPE=${3:-$TYPE}
9-
10-
echo "$TITLE - $TYPE - $SHIELD_IO_TYPE"
119

12-
FIND="\(https://github.com/(.*)/(.*)/$TYPE/(.*)\)"
10+
FIND="\(https://github.com/([^/]*)/([^/]*)/$TYPE/([^)]*)\)"
1311
SUBS="(https:\/\/github.com\/\1\/\2\/$TYPE\/\3) ![$TITLE \3 badge](https:\/\/shields.io\/github\/$SHIELD_IO_TYPE\/detail\/state\/\1\/\2\/\3)"
1412

1513
sed -ibak -E "s|$FIND|$SUBS|g" src/*-*.md

0 commit comments

Comments
 (0)