-
Notifications
You must be signed in to change notification settings - Fork 124
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
Feature Request: Add a way to pass args
to script_runner
of a condition_script
#1081
Comments
Currently, I am working around this with a plugin, but I think this would be better suited inside of cargo-make itself. Especially since afaik, there is no way to run multiple different plugins. [plugins.impl.rust-condition-script-cargo_make_current_task_initial_makefile_directory-substitution]
script = '''
# Parse task json into variables
taskjson = json_parse ${task.as_json}
# Convert backslashes to forward slashes
rust-driver-toolchian-path = replace ${taskjson.env.CARGO_MAKE_CURRENT_TASK_INITIAL_MAKEFILE_DIRECTORY} "\\" "/"
# Replace the ${CARGO_MAKE_CURRENT_TASK_INITIAL_MAKEFILE_DIRECTORY} variable in the condition_script with the rust-driver-toolchian-path
taskjson.condition_script = replace ${taskjson.condition_script} "\${CARGO_MAKE_CURRENT_TASK_INITIAL_MAKEFILE_DIRECTORY}" "${rust-driver-toolchian-path}"
# Reencode variables into json
taskjson = json_encode taskjson
# Run the invoking task, with the modified condition_script
cm_plugin_run_custom_task ${taskjson}
''' |
sagiegurari
added a commit
that referenced
this issue
May 17, 2024
@wmmc88 this is now available in the dev branch 0.37.13 and i would love your feedback as i did really bare minimum of tests. |
@wmmc88 this is now officially release |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature Description
I want to do the same thing as #1025, but for a
condition_script
instead of a normalscript
block.shebang support for condition scripts was added to resolve #987, but it looks like there isn't an equivalent to
script_runner_args
to pass args to the script runner selected by the shebang. I would like to pass args to therust-script
runner for the same reasons as in #1025.Describe The Solution You'd Like
Since the syntax for
condition_script
is slightly different that normalscript
, I'm not sure what the solution should look like. The simplest thing may by just to have acondition_script_runner_args
field, but that is a little odd because there is no accompanyingcondition_script_runner
field (i.e. using different runners only works via shebangs).The text was updated successfully, but these errors were encountered: