CDSoft / pp

PP - Generic preprocessor (with pandoc in mind) - macros, literate programming, diagrams, scripts...

Home Page:http://cdelord.fr/pp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How hard would it be to support fish/zsh scripts?

oscarvarto opened this issue · comments

Not an issue, but a question/request.

What I see is that bash is assumed. Is there a way to call fish/zsh instead of assuming the shell is bash?

Thanks!

A quick and dirty workaround would be to use sh to call any other shell.
fish or zsh support can also easily be added.
Another solution could also to make the script executable and rely on the shebang header but I guess it is not portable (well, it just doesn't work on windows...)

I will add explicit support for fish and zsh and think about a generic mechanism based on the shebang header (maybe not portable to windows).

To use the shebang header we can modify the !sh macro. If the script is called with the -c option it will be executed as if it were called on the command line and the shebang header is interpreted. If there is no shebang header, the default shell is called (sh).

done in pp 2.7: explicit zsh and fish support + she bang support in sh and exec macros

Thanks so much!