ResolveProject (fnord v0.9.37)

View Source

Project resolution from the current working directory.

Behavior:

  • With no explicit cwd, the effective directory is the session's project root override (Settings.get_project_root_override/0) when set, else the real cwd. In prod the override is always nil at resolution time; see the comment in resolve/1.
  • If inside a git worktree, resolve/1 will map the cwd to the repository root.
  • Select the configured project whose root contains that directory, choosing the one with the deepest (longest) root path.

Returns {:ok, project_name} or {:error, :not_in_project}.

Summary

Types

project_name()

@type project_name() :: binary()

Functions

resolve(cwd \\ nil)

@spec resolve(cwd :: binary() | nil) ::
  {:ok, project_name()} | {:error, :not_in_project}