File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ usage() {
1212 EOU
1313}
1414
15- readme =" ${1:- } "
16- if ! shift || [ ! -f " $readme " ]; then usage >&2 ; exit 1; fi
15+ markdown =" ${1:- } "
16+ if ! shift || [ ! -f " $markdown " ]; then usage >&2 ; exit 1; fi
1717
1818toc=" $(
1919 gawk '
@@ -44,10 +44,10 @@ toc="$(
4444
4545 printf "%s[%s](#%s)\n", prefix, $0, hash
4646 }
47- ' " $readme "
47+ ' " $markdown "
4848) "
4949
50- toFile=" ${readme } .bak"
50+ toFile=" ${markdown } .bak"
5151gawk -v toFile=" $toFile " -v toc=" $toc " '
5252 BEGIN { printf "" > toFile }
5353 /^<!-- AUTOGENERATED TOC -->$/ {
@@ -64,10 +64,10 @@ gawk -v toFile="$toFile" -v toc="$toc" '
6464 }
6565 !inToc { print >> toFile }
6666 END { if (!seenToc) { close(toFile); printf "" > toFile } }
67- ' " $readme "
67+ ' " $markdown "
6868
6969if [ -s " $toFile " ]; then
70- mv " $toFile " " $readme "
70+ mv " $toFile " " $markdown "
7171else
7272 rm " $toFile "
7373 echo " $toc "
You can’t perform that action at this time.
0 commit comments