allow remote binary customization by drzraf · Pull Request #6013 · wp-cli/wp-cli
Could be set to use /custom/path/wp on the remote end but also sudo -u user /some/wp to allow running wp under a distinct user.
See also #5974
So that case of "let the remote user specify what wp is" seems already covered by existing practices.
non-interactive mode is not firing a "login-shell". ~/.bashrc isn't read and the aliases it may contain are not defined.
It addresses the problem in a way that doesn't need any hook nor modification on the remote server (like .bashrc to add aliases), either because:
- These are not available
- It's undesirable (because it need to work for multiple users with distinct
.bashrc) - Because it's cumbersome to enable alias expansion, just to set on wp
aliasjust to runwpwith sudo under another user.
(and the diff in the codebase is just one-line)
I think WP_CLI_BINARY is too vague because it is only used in SSH context with this PR. We already have WP_CLI_SSH_PRE_CMD so maybe this could be WP_CLI_SSH_BINARY / WP_CLI_SSH_REMOTE_BINARY / WP_CLI_SSH_REMOTE_WP_BINARY
Suggesting because these should also end up documented here in the list of all available ENV Vars that WP CLI supports and every other use of WP_CLI_XXX is for the local version, not the remote.
…o `sudo -u user /some/wp` would also allow running remote `wp-cli` under a distinct user
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