diff --git a/pkg/toc/toc.go b/pkg/toc/toc.go index 9305a3a..38449d7 100644 --- a/pkg/toc/toc.go +++ b/pkg/toc/toc.go @@ -56,16 +56,15 @@ func (t *toc) logic() { } if t.Options.Append == true { - err = t.writeToFile(string(resp)) - if err != nil { + if err = t.writeToFile(string(resp)); err != nil { color.Red(err.Error()) os.Exit(1) } + color.Green("✔ Table of contents generated successfully") } else { fmt.Print(t.String()) } - color.HiGreen("✔ Table of contents generated successfully.") } func (t *toc) String() (s string) {