Skip to content

Direct insert not working on Linux Mint #86

Open
@svartkanin

Description

@svartkanin

I was using the direct insert flag --insert to directly insert the TOC into the readme.md. I've added the two lines

<!--ts-->
<!--te-->

into the readme but when running the script with the --insert flag I get the output:

You don't have <!--ts--> or <!--te--> in your file...exiting

I've found the part in the script that does the search for the tags

 if grep -Fxq "<!--ts-->" $gh_src && grep -Fxq "<!--te-->" $gh_src; then

which seems to fail. I've run the command manually on Linux Mint 19

grep -Fxq "<!--ts-->" Readme.md

and I get the error

bash: !-: event not found

For my workaround I had to escape the syntax to this form

if grep -xq "<\!--ts-->" $gh_src && grep -xq "<\!--te-->" $gh_src; then

Line 178 returns the following error

./gh-md-toc: line 178: [: =: unary operator expected```

should probably be changed to

 if [ "$no_backup" = "yes" ]; then

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions