Skip to main content

Module workspace

Module workspace 

Source
Expand description

The workspace (spec/sync/README.md §1): the directory holding .omgbase/, discovered by walking up like git; its repos with their derived root paths; repo selection for a command run in some cwd.

Structs§

RepoRow
A repo as the workspace lists it.
RepoSelection
Why select_repo found nothing: repo_not_found with the slugs that exist.
Workspace
An open workspace: its root, .omgbase/ directory, database path and store.

Constants§

DB_FILE
The database file inside it (spec/store §1).
OMGBASE_DIR
The directory a workspace is recognised by.
WORKSPACE_ENV
The environment variable that names a workspace when no flag does.

Functions§

find_root
Walk up from start to the filesystem root; the first directory holding a .omgbase directory is the workspace root (§1).
fs_root_from_config
The root of an fs source’s stored config JSON, or None when the config is unparsable, the root is not a string, or it is empty.
list_repos
The repos of a store with their derived root paths, ordered by slug (§1: attachments joined to sources with adapter = 'fs', the first non-empty root per repo).
select_repo
§1 repo selection, pure over the rows: an explicit slug must exist; else with exactly one repo, that repo; else the repos whose root path contains cwd (sourceless repos never match) — exactly one → it; none → repo_not_found; several → the longest resolved root path.