From 9c6888b694f6b17592f342e765391cc549435045 Mon Sep 17 00:00:00 2001 From: Robert Prehn <3952444+prehnRA@users.noreply.github.com> Date: Thu, 10 Aug 2023 10:58:02 +0000 Subject: [PATCH] chore: Add :env to helper documentation --- lib/mash/helpers.ex | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/mash/helpers.ex b/lib/mash/helpers.ex index b348877..4b05557 100644 --- a/lib/mash/helpers.ex +++ b/lib/mash/helpers.ex @@ -3,8 +3,13 @@ defmodule Mash.Helpers do Helpers that provide a simple way to write Mash configs. """ - @doc "Create a run function for a job that executes a mix task with name `task_name` and the arguments `args`" - @spec mix(String.t(), [String.t()]) :: function() + @doc """ + Create a run function for a job that executes a mix task with name `task_name` and the arguments `args`. + + Available opts: + - `:env` -- a list of {key, value} pairs that will be used as environment variables. + """ + @spec mix(String.t(), [String.t()], Keyword.t()) :: function() def mix(task_name, args \\ [], opts \\ []) do env = Keyword.get(opts, :env, []) @@ -21,8 +26,11 @@ defmodule Mash.Helpers do @doc """ Create a run function which executes the script/binary named `command` with the arguments `args`. + + Available opts: + - `:env` -- a list of {key, value} pairs that will be used as environment variables. """ - @spec shell(String.t(), [String.t()]) :: function() + @spec shell(String.t(), [String.t()], Keyword.t()) :: function() def shell(command, args \\ [], opts \\ []) do env = Keyword.get(opts, :env, [])