sergiocorreia/panflute

Shell mode for the `shell` function

Closed this issue · 1 comments

Hey,
I'm trying to run @mermaid-js/mermaid-cli (mmdc executable) on Windows from a panflute script, but it seems that they are actually shell scripts rather than actual binaries, but in order to use Popen as is, it look like it has to be.

Adding the argument shell=True in the Popen constructor should do the trick but I'm not that sure so that's the object of this issue... 😅

ickc commented

We need more details as I don't even know what your script looks like. A minimal working example would be nice.

And I'm not sure why would that be a panflute issue? May be you're using some of panflute's helper functions? You can call Popen or subprocess.run on your own in your filter.

As a sidenote, mermaid filters exist that use pandocfilters. You may check out the pandoc wiki to see which one you like.

Also see B602: subprocess_popen_with_shell_equals_true — Bandit documentation for potential issue. But if your script hard coded the commands to run, its probably fine.

Closing until more details are provided.