jacobdeichert / mask

🎭 A CLI task runner defined by a simple markdown file
MIT License
1.11k stars 55 forks source link

Fix issue where command before level 1 heading was ignored #77

Closed jacobdeichert closed 3 years ago

jacobdeichert commented 3 years ago

The command before a level 1 heading wasn't being pushed into the array of commands (line 26 in the parser).

However, after the parser is done, the last command was correctly being added to the list of commands. The problem was that when a level 1 heading is found, that last command is overwritten and lost.

Which issue does this fix?

Closes #75

Describe the solution

I decided that if we see another level 1 heading within the document, the parser should stop (break) there. Anything below that level 1 heading will be ignored... so that might be a good place to put documentation or other content.