File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -118,12 +118,16 @@ gh_toc(){
118118 local toc_footer=" <!-- Added by: ` whoami` , at: ` date --iso-8601=' minutes' ` -->"
119119 # http://fahdshariff.blogspot.ru/2012/12/sed-mutli-line-replacement-between-two.html
120120 # clear old TOC
121- sed -i${ext} " /${ts} /,/${te} /{//!d}" " $gh_src "
121+ sed -i${ext} " /${ts} /,/${te} /{//!d; }" " $gh_src "
122122 # create toc file
123123 echo " ${toc} " > " ${toc_path} "
124124 echo -e " \n${toc_footer} \n" >> " $toc_path "
125125 # insert toc file
126- sed -i " /${ts} /r ${toc_path} " " $gh_src "
126+ if [[ " ` uname` " == " Darwin" ]]; then
127+ sed -i " " " /${ts} /r ${toc_path} " " $gh_src "
128+ else
129+ sed -i " /${ts} /r ${toc_path} " " $gh_src "
130+ fi
127131 echo
128132 echo " !! TOC was added into: '$gh_src '"
129133 echo " !! Origin version of the file: '${gh_src}${ext} '"
You can’t perform that action at this time.
0 commit comments