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

[std] Add more functions for creating runnables #115

Merged
merged 5 commits into from
Oct 5, 2024
Merged

Conversation

kylewlacy
Copy link
Member

This PR adds a few new functions to std used for creating runnables:

  • std.withRunnable(recipe, options): Add a new binary in the recipe at the path brioche-run. The options include the command, args, and envs to run.
  • std.addRunnable(recipe, path, options): Add a new binary in the recipe at the path specified by path. Same options as std.withRunnable, just with a custom path instead of always using brioche-run.

These new functions are meant to be a middle-ground between std.withRunnableLink() (where you can only directly run another executable) and std.bashRunnable (where you get a lot more flexibility, but need to include Bash as a dependency). By comparison, the new functions allows minimal templating for the command, args, and envs, but not the full capabilities of a whole shell.

Internally, std.bashRunnable now uses std.withRunnable() to actually build the runnable, which in turn uses std.addRunnable().

@kylewlacy kylewlacy merged commit 35e3bf3 into main Oct 5, 2024
3 checks passed
@kylewlacy kylewlacy deleted the std-runnable branch October 5, 2024 09:01
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