Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make snippet executors multiplatform #282

Merged
merged 1 commit into from
Jul 13, 2024

Conversation

mfontanini
Copy link
Owner

@mfontanini mfontanini commented Jul 13, 2024

Recently it was brought up in #271 (comment) 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.

@mfontanini mfontanini mentioned this pull request Jul 13, 2024
@mfontanini mfontanini force-pushed the feat/multiplatform-executors branch 2 times, most recently from 3288739 to a2df29d Compare July 13, 2024 00:48
@mfontanini mfontanini merged commit 4ec7679 into master Jul 13, 2024
6 checks passed
@mfontanini mfontanini deleted the feat/multiplatform-executors branch July 13, 2024 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant