Expand description
Path and repository-name handling for work facts: one spelling for every
path (forward slashes, no trailing slash), repository-relative paths so
two clones of the same repository compare equal, owner/repo from a
remote URL, and where bashwrap keeps an agent’s live working folder.
Functions§
- clean_
relative - A repository-relative path as a caller typed it: forward slashes, no
leading
./or/, no trailing slash..is the whole repository (""). - cwd_
state_ file - Where bashwrap keeps this agent’s live working folder:
~/.agentmux/state/bashwrap-cwd/<key>.cwd, unless the env overrides it. - is_
absolute - Whether
rawnames an absolute path in any of the spellings agents use. - normalize_
path - One spelling for a path:
\becomes/, an MSYS/c/...becomesC:/..., repeated slashes collapse and a trailing slash goes. - normalize_
repo - The key of a repository, lowercase, from a remote URL in any of git’s spellings (
https://host/owner/repo.git,git@host:owner/repo,ssh://...), or from anowner/repoa caller typed. Credentials in a URL never survive. - path_
matches - Whether the repository-relative
fileistargetor inside it. An empty target is the whole repository. A file ending in/is an untracked folder git reported whole, which matches anything inside it too. - relative_
to pathrelative toroot(both normalized), orNonewhen it isn’t inside it. The root itself is"".- working_
folder - The agent’s working folder: the live one bashwrap recorded when it names
a folder that still exists, else the folder it started in (
cmd:cwd).