feat: Add if
This commit is contained in:
parent
c8fd5e9f2d
commit
17d4654100
2 changed files with 3 additions and 3 deletions
|
@ -8,12 +8,12 @@ defmodule Mash.Job do
|
||||||
or the function returns true. Otherwise it will be skipped. The argument to an if function is the runner's \
|
or the function returns true. Otherwise it will be skipped. The argument to an if function is the runner's \
|
||||||
job list.
|
job list.
|
||||||
- `:needs`: a list of job name atoms which are required before running this job. If a dependency fails or is skipped, \
|
- `:needs`: a list of job name atoms which are required before running this job. If a dependency fails or is skipped, \
|
||||||
this job will be skipped. You can also include {job_name, :optional} to indicate an optional dependency. \
|
this job will be skipped. You can also include `{job_name, :optional}` to indicate an optional dependency. \
|
||||||
Optional dependencies do not block a job from running if they are skipped, only if they fail.
|
Optional dependencies do not block a job from running if they are skipped, only if they fail.
|
||||||
- `:run`: a function with arity 1 that is the code to be executed for the job. See `Mash.Helpers` for shortcut functions.\
|
- `:run`: a function with arity 1 that is the code to be executed for the job. See `Mash.Helpers` for shortcut functions.\
|
||||||
The argument to the run function is the PID of the IO device which is capturing the output of this job. You\
|
The argument to the run function is the PID of the IO device which is capturing the output of this job. You\
|
||||||
probably don't need this, but you might need it for certain libaries that need to be passed an explicit IO PID.
|
probably don't need this, but you might need it for certain libaries that need to be passed an explicit IO PID.
|
||||||
- `:env`: an array of {string, string} pairs which represent ENV variables (name first, then value).
|
- `:env`: an array of `{string, string}` pairs which represent ENV variables (name first, then value).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
defstruct name: nil, if: true, needs: [], run: nil, env: [], state: nil, task: nil, io_pid: nil
|
defstruct name: nil, if: true, needs: [], run: nil, env: [], state: nil, task: nil, io_pid: nil
|
||||||
|
|
2
mix.exs
2
mix.exs
|
@ -4,7 +4,7 @@ defmodule Mash.MixProject do
|
||||||
def project do
|
def project do
|
||||||
[
|
[
|
||||||
app: :mash,
|
app: :mash,
|
||||||
version: "0.2.0",
|
version: "0.3.0",
|
||||||
elixir: "~> 1.14",
|
elixir: "~> 1.14",
|
||||||
start_permanent: Mix.env() == :prod,
|
start_permanent: Mix.env() == :prod,
|
||||||
deps: deps(),
|
deps: deps(),
|
||||||
|
|
Loading…
Reference in a new issue