mix composer.recipe.run (composer v0.2.0)

Copy Markdown View Source

Resolves a recipe and applies it to the current app as one diff, then records the run as one git commit.

mix composer.recipe.run app/default
mix composer.recipe.run local:phx/app --gigalixir --oban-pro
mix composer.recipe.run app/default --dry-run
mix composer.recipe.run app/default --no-commit

The recipe reference is "cookbook:group/name" or an unqualified "group/name", which is looked up in the current project's cookbook first, then in every cookbook including local. mix composer.recipe.list lists them.

Every flag declared in the flags: of the recipe, or of a recipe it :uses, becomes a --flag option; mix composer.recipe.show RECIPE shows them. Any other --flag is rejected.

Before anything runs, every reference is resolved and the steps' requires are checked; a missing executable or an incompatible package version stops the run.

Git commit

Unless --no-commit is given, the run:

  1. refuses to start if the app is not inside a git work tree, or if the tree has uncommitted, unstaged or untracked changes. This is checked before anything is written, including the dependency fetch;
  2. applies the steps as one diff, without asking (see below);
  3. commits everything with git add -A and a message listing the config directory, the flags, and every step with the recipe it came from.

The commit is a queued task, so it runs last, after any {:queue, ...} steps, and only if the diff is applied. --dry-run commits nothing.

Unattended runs

The run always acts as if --yes were given: it applies the diff and fetches dependencies without asking, so it goes through unattended. The diff isn't shown; use --dry-run to preview it first (a dry run doesn't add --yes, since Igniter hides the diff under it).

Options

  • -c, --config - the local config directory (see Composer.Local)
  • --no-commit - skip the git checks and the commit
  • --dry-run - as for any Igniter task
  • --yes - implied unless --dry-run is given