File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ set -o nounset
6
6
set -o pipefail
7
7
[[ " ${TRACE-0} " =~ ^1| t| y| true| yes$ ]] && set -o xtrace
8
8
9
+ FILE=" README.md"
10
+
9
11
MARKER_NATIVE=" <magic-marker-nbr-native>"
10
12
MARKER_EXTENSIONS=" <magic-marker-nbr-extensions>"
11
13
@@ -17,7 +19,7 @@ SIGN_EXTENSIONS=:heavy_plus_sign:
17
19
18
20
count_occurences () {
19
21
local sign=" $1 "
20
- c=$( grep --count " $sign " README.md )
22
+ c=$( grep --count " $sign " " $FILE " )
21
23
echo $(( $c - 1 )) # Listed in explanation - does not count!
22
24
}
23
25
@@ -27,8 +29,8 @@ update_count() {
27
29
local search=" $3 "
28
30
29
31
img_tag=$( printf " $template " " $count " )
30
- sed -i.bak -e " s|^.*${search} .*$|${img_tag} |" README.md
31
- test -e README.md. bak && rm README.md. bak
32
+ sed -i.bak -e " s|^.*${search} .*$|${img_tag} |" " $FILE "
33
+ test -e " ${FILE} . bak" && rm " ${FILE} . bak"
32
34
}
33
35
34
36
count_native=$( count_occurences $SIGN_NATIVE )
You can’t perform that action at this time.
0 commit comments