[tasks.duckscript] script_runner = "@duckscript" script = "echo Hello World!" [tasks.duckscript-example] script_runner = "@duckscript" script = ''' task_name = get_env CARGO_MAKE_CURRENT_TASK_NAME echo The currently running cargo make task is: ${task_name} # since all env vars are auto loaded as duckscript variables by cargo-make # you can access them directly echo The currently running cargo make task is: ${CARGO_MAKE_CURRENT_TASK_NAME} cd .. # this changes cargo-make current working directory (cargo-make will revert to original directory after script execution) pwd set_env CARGO_MAKE_CURRENT_TASK_NAME tricking_cargo_make ''' [tasks.duckscript-shebang-example] script = ''' #!@duckscript echo Running duckscript without runner attribute. ''' [tasks.run-task-from-duckscript] script_runner = "@duckscript" script = ''' echo first invocation of echo1 task: cm_run_task echo1 echo second invocation of echo1 task: cm_run_task echo1 echo running task: echo2: cm_run_task echo2 ''' [tasks.before-echo] command = "echo" args = ["before echo"] [tasks.echo1] dependencies = ["before-echo"] command = "echo" args = ["1"] [tasks.echo2] command = "echo" args = ["2"] [tasks.sleep_wrapper] run_task = { name = ["sleep", "sleep"] } [tasks.sleep] script = ''' #!@duckscript sleep 1000 ''' [tasks.echo-after-sleep] dependencies = ["sleep"] run_task = "echo1" [tasks.run-async-task-from-duckscript] script_runner = "@duckscript" script = ''' echo before invocation cm_run_task --async echo-after-sleep echo after invocation sleep 1500 ''' [tasks.cli_args] script = ''' #!@duckscript all_values = array_join ${@} ", " echo all args: ${all_values} echo some fielded values: echo 1: ${1} echo 2: ${2} echo 3: ${3} '''