Skip to main content

Module helpers

Module helpers 

Source

Enums§

Probe
What the post-install probe (pxh --version through the same candidate paths sync --remote uses) established about the remote.

Constants§

INSTALL_SCRIPT_URL 🔒

Functions§

bootstrap_report
The install line of a bootstrap: what got installed and whether the probe of its own path confirmed it.
build_remote_pxh_command
Build a shell command that finds and executes pxh on the remote host. When a single explicit path is configured, uses it directly. Otherwise, probes a prioritized list of candidate locations.
default_remote_db_expr
Return a shell expression that resolves the pxh database path on a remote host. Checks XDG path first, falls back to legacy ~/.pxh.
determine_is_pxhs
Determine if the executable is being invoked as pxhs (shorthand for pxh show)
findability_report
Whether plain pxh sync --remote <host> would run the binary just installed: plain is the probe through sync’s candidate paths, installed the probe of the install path. None when they agree (or nothing can be said); otherwise the warning naming the fix.
get_relative_path_from_home
Gets the relative path from home directory if the current executable is within it. Returns None if the executable is not in the home directory. Takes optional overrides for testing.
install_command
The remote install command line: fetch install.sh, then run it with the release as $1. The script is fetched into a variable first – sh -c "$(curl ...)" alone runs an empty command (exit 0) when the fetch fails, and the install would be reported as done.
parse_probe_output
The probe’s answer is its last stdout line (a remote rc file that echoes on login puts noise in front of it), of the form pxh X.Y.Z (...).
parse_ssh_command
Parse an SSH command string into command and arguments, handling quotes and spaces. Similar to how rsync and other tools parse the -e option.
quote_remote_install_dir
Quote --install-dir for interpolation into the remote install command. A leading ~ becomes "$HOME" so it still expands on the remote; the rest is quoted so spaces and metacharacters are inert.
remote_pxh_candidates 🔒
Build a list of candidate paths to search for pxh on the remote host. The first candidate that exists and is executable will be used.
remote_pxh_path
The installed executable as a remote shell word: quoted like the install dir, so a directory with spaces works and ~ still expands.
shell_quote
Single-quote s for a POSIX shell unless it is plainly safe as-is.