fix(cli): make rsync optional, require only for ssh-manager sync (#22 follow-up)#26
Merged
Conversation
…ync` (#22) Reported by @Eleef while validating the Windows wrapper fix in #23. After the wrapper started working, `server add` (and every other command) still exited at startup with: Missing required dependencies: rsync rsync was listed alongside `ssh` in the global `check_dependencies` gate, but it is only used by `cmd_sync`. Git for Windows (and most out-of-the-box MSYS2/Cygwin setups) does not ship rsync, so this gate prevented the CLI from running at all on a fresh Windows install — even for users who never intend to call `sync`. Changes: - `cli/lib/config.sh`: drop rsync from the required list, add it to the optional warning, and introduce a small `require_command` helper that prints actionable install hints (macOS/Debian/Windows). - `cli/ssh-manager`: `cmd_sync` calls `require_command rsync` so the failure happens at the point of use with a clear message instead of blocking startup. - `cli/install.sh`: same reclassification in the installer's dependency probe so users see a yellow warning, not a red blocking error. Verified locally on macOS by stripping rsync from PATH: - `--version`, `--help`, `server list` → exit 0 (warn-only) - `sync push ...` → exit 1 with install hints Closes the residual rsync issue surfaced in #22; complements #23.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #22, surfaced while @Eleef was validating the Windows wrapper in #23. After the npm shim was fixed,
server add(and every other command) still exited at startup with:rsyncwas in the required list of the globalcheck_dependenciesgate alongsidessh, but it is only used bycmd_sync. Git for Windows / fresh MSYS2 setups don't ship rsync, so the CLI was unusable on a stock Windows install for users who never intend to callsync.Changes
cli/lib/config.sh— droprsyncfrom the required list, add it to the optional warning. Newrequire_command <cmd> <feature>helper prints actionable install hints (macOS / Debian / Windows).cli/ssh-manager—cmd_syncnow callsrequire_command rsync "ssh-manager sync"so the failure happens at the point of use with a clear message instead of blocking startup.cli/install.sh— same reclassification in the installer's dependency probe (yellow warning, not red blocking error).Only
sshitself remains in the required set.Verified locally
Tested on macOS by running the CLI with a stripped PATH that contains
sshbut notrsync:ssh-manager --versionMissing required dependencies: rsyncssh-manager --helpssh-manager server listssh-manager sync push ...Test plan (Windows reviewer)
After #23 is merged (or stacked on this branch), on a stock Git-for-Windows install without rsync:
ssh-manager --versionworksssh-manager --helpworksssh-manager server addwalks through the prompts to completionssh-manager server listshows the yellowMissing optional dependencies: rsync ...line but still lists serversssh-manager sync push <server> <src> <dst>fails with the new actionable error pointing at MSYS2/WSLRelation to other PRs