SvelixirNew.Shell (svelixir_new v0.11.0)

Copy Markdown

The two effectful operations of the bootstrap, each behind an injected seam so every branch is reachable in-process.

The seams are not indirection for its own sake: without them the fail-loudly branches are reachable only by spawning a subprocess or installing an archive, which under minimum_coverage: 100 forces machine-coupled tests into the coverage run — and a flaky coverage gate is how a suite gets tagged out and then silently stops running.

Both defaults are literals in the function head rather than captures or named private functions. &default_runner/2 would leave defp default_runner/2 permanently uncovered, and a closure default costs an uncovered line the ignore budget cannot absorb.

Summary

Functions

Runs mix ARGS in cd, raising with the captured output on any non-zero exit.

Asserts a generator task is reachable.

Types

lookup()

@type lookup() :: (String.t() -> module() | nil)

runner()

@type runner() :: {module(), atom()}

Functions

cmd!(args, cd, arg \\ {System, :cmd})

@spec cmd!([String.t()], Path.t(), runner()) :: binary()

Runs mix ARGS in cd, raising with the captured output on any non-zero exit.

ensure_task_available!(name, lookup \\ &Mix.Task.get/1)

@spec ensure_task_available!(String.t(), lookup()) :: :ok

Asserts a generator task is reachable.

Must be called BEFORE any dependency work: mix deps.compile prunes every archive off the code path, after which this returns nil for an archive that is still installed on disk.