From f6bfd2b1757116e624ed8e71fd50db2191510baf Mon Sep 17 00:00:00 2001 From: Jordan Trask Date: Wed, 29 Apr 2020 09:00:29 -0700 Subject: [PATCH] Removed tabs and replaced with spaces, fixed error with $no_backup wasn't defined, added in default file README.md when no $src is defined --- gh-md-toc | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/gh-md-toc b/gh-md-toc index 9cf4da2..55242a9 100755 --- a/gh-md-toc +++ b/gh-md-toc @@ -104,12 +104,6 @@ gh_toc(){ local need_replace=$3 local no_backup=$4 - if [ "$gh_src" = "" ]; then - echo "Please, enter URL or local path for a README.md" - exit 1 - fi - - # Show "TOC" string only if working with one document if [ "$gh_ttl_docs" = "1" ]; then @@ -182,7 +176,7 @@ gh_toc(){ if [ -z $no_backup ]; then echo "!! Origin version of the file: '${gh_src}${ext}'" echo "!! TOC added into a separate file: '${toc_path}'" - fi + fi echo fi fi @@ -195,11 +189,11 @@ gh_toc(){ # It's need if TOC is generated for multiple documents. # gh_toc_grab() { - # if closed is on the new line, then move it on the prev line - # for example: - # was: The command foo1 - # - # became: The command foo1 + # if closed is on the new line, then move it on the prev line + # for example: + # was: The command foo1 + # + # became: The command foo1 sed -e ':a' -e 'N' -e '$!ba' -e 's/\n<\/h/<\/h/g' | # find strings that corresponds to template grep -E -o '