CDSoft / pp

PP - Generic preprocessor (with pandoc in mind) - macros, literate programming, diagrams, scripts...
http://cdelord.fr/pp
GNU General Public License v3.0
252 stars 21 forks source link

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

Closed oscarvarto closed 5 years ago

oscarvarto commented 5 years ago

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!

CDSoft commented 5 years ago

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).

CDSoft commented 5 years ago

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).

CDSoft commented 5 years ago

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

oscarvarto commented 5 years ago

Thanks so much!