Skip to main content

Module util

Module util 

Source
Expand description

Shared tool helpers: path resolution and display.

Functions§

display_path
Stringify a path for display given the raw (possibly relative) input.
expand_tilde
Expand a leading ~ to the user’s home directory.
resolve_read_path
Alias mirroring pi’s resolveReadPath (same semantics as resolveToCwd).
resolve_to_cwd
Resolve a tool-provided path against the working directory. Absolute paths (and ~-expanded paths) are used as-is; relative paths are joined to cwd.
shorten_path
Render a path compactly: relative to cwd when inside it, otherwise ~- abbreviated when inside the home dir.