Composer.Preflight (composer v0.2.0)

Copy Markdown View Source

Checks the requires of the steps about to run, before anything runs.

  • {:executable, name} must be found on PATH.
  • {:package, name, requirement} must match the version of name when the target app already has that package; a package the app doesn't have yet passes, since an earlier step may install it.

Both are errors. A required step that is not listed earlier is only a warning, reported by Composer.Resolver.warnings/1.

Summary

Functions

Checks entries, returning :ok or {:error, {:requires_unmet, failures}} where each failure is a message line.

Functions

check(entries, opts \\ [])

@spec check(
  [Composer.Resolver.entry()],
  keyword()
) :: :ok | {:error, term()}

Checks entries, returning :ok or {:error, {:requires_unmet, failures}} where each failure is a message line.

Options

  • :find_executable - (name -> path | nil), for tests

  • :package_version - (name -> version | nil), for tests