ResolveProject (fnord v0.9.36)
View SourceProject 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 inresolve/1. - If inside a git worktree,
resolve/1will 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
@type project_name() :: binary()
Functions
@spec resolve(cwd :: binary() | nil) :: {:ok, project_name()} | {:error, :not_in_project}