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.
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.
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.
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.
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.