chore: Add :env to helper documentation

This commit is contained in:
Robert Prehn 2023-08-10 10:58:02 +00:00
parent dbb6241c40
commit 9c6888b694
No known key found for this signature in database

View file

@ -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, [])