Recently it was brought up in https://github.com/mfontanini/presenterm/issues/271#issuecomment-2201031920 that snippet code execution doesn't work in Windows because it used a bash script to run. This change addresses that and changes the way executors are defined entirely so that rather than being a bash script per language, they're defined in a executors.yaml file baked into the presenterm binary and can similarly be extended within the config file placed in ~/.config/presenter/config.yaml.
This makes defining executors much simpler as you have a single file with all of them and you don't have to deal with tempdirs and whatnot. Every time a snippet is executed the following now happens:
A new tempdir is created.
The snippet contents are written into ${tempdir}/${filename} where filename is defined by the snippet execution config.
A set of commands defined in the execution config are run one by one using the tempdir as the cwd. This means they don't need to deal with absolute paths or any other annoying detail.
Optionally a set of environment variables can be set before invoking all commands.
The output of all of these commands will be visible in the presentation.
Recently it was brought up in https://github.com/mfontanini/presenterm/issues/271#issuecomment-2201031920 that snippet code execution doesn't work in Windows because it used a bash script to run. This change addresses that and changes the way executors are defined entirely so that rather than being a bash script per language, they're defined in a
executors.yaml
file baked into thepresenterm
binary and can similarly be extended within the config file placed in~/.config/presenter/config.yaml
.This makes defining executors much simpler as you have a single file with all of them and you don't have to deal with tempdirs and whatnot. Every time a snippet is executed the following now happens:
${tempdir}/${filename}
wherefilename
is defined by the snippet execution config.cwd
. This means they don't need to deal with absolute paths or any other annoying detail.