pub fn project_ecosystem(
dir: &str,
present: impl Fn(&str) -> bool,
) -> Result<Ecosystem, Error>Expand description
The one ecosystem whose manifest and lockfile are both in dir, as present reports each
file name, or the refusal naming the remedy.
Exactly one ecosystem, and both halves of its pair, because each miss has a different remedy and the refusal names it:
- No pair at all: the directory is not a project this feature understands, and the message lists all three pairs it looked for.
- A manifest without its lockfile: the environment layer is keyed on the lockfile (#74), so there is nothing to key on, and the message names the command that writes one.
- A lockfile without its manifest: the install step reads both, so the layer could never build. Most likely a partial copy.
- Two ecosystems at once: one image bakes one layer, and nothing says which, so the refusal names both rather than picking one silently.
dir is the directory as the caller named it, for the messages.