Merge claude/1
This commit is contained in:
commit
a7d819799f
@ -39,22 +39,27 @@ dockerCommandRunInstallUser()
|
||||
"PATH=/home/$CFG_DOCKER_INSTALL_USER/bin:/usr/bin:/bin:/usr/local/bin"
|
||||
)
|
||||
|
||||
# Run from the install user's HOME, not the caller's cwd. At install time the
|
||||
# caller is root in /root, which the unprivileged user can't enter, so
|
||||
# cwd-sensitive tools error (e.g. find: "Failed to change directory: /root").
|
||||
local run_cwd="/home/$CFG_DOCKER_INSTALL_USER"
|
||||
|
||||
# --argv: exec the remaining args verbatim (no shell re-parse) so regex/
|
||||
# quotes/backslashes in arguments (e.g. sed scripts) survive intact. Default:
|
||||
# treat $1 as a shell snippet via bash -c (needed for pipes/redirects/
|
||||
# systemctl --user/etc.).
|
||||
if [ -n "$argv_mode" ]; then
|
||||
if [ -n "$silent_flag" ]; then
|
||||
sudo -u "$CFG_DOCKER_INSTALL_USER" env "${run_env[@]}" "$@" >/dev/null 2>&1
|
||||
sudo -u "$CFG_DOCKER_INSTALL_USER" env --chdir="$run_cwd" "${run_env[@]}" "$@" >/dev/null 2>&1
|
||||
else
|
||||
sudo -u "$CFG_DOCKER_INSTALL_USER" env "${run_env[@]}" "$@"
|
||||
sudo -u "$CFG_DOCKER_INSTALL_USER" env --chdir="$run_cwd" "${run_env[@]}" "$@"
|
||||
fi
|
||||
else
|
||||
local remote_command="$1"
|
||||
if [ -n "$silent_flag" ]; then
|
||||
sudo -u "$CFG_DOCKER_INSTALL_USER" env "${run_env[@]}" bash -c "$remote_command" >/dev/null 2>&1
|
||||
sudo -u "$CFG_DOCKER_INSTALL_USER" env --chdir="$run_cwd" "${run_env[@]}" bash -c "$remote_command" >/dev/null 2>&1
|
||||
else
|
||||
sudo -u "$CFG_DOCKER_INSTALL_USER" env "${run_env[@]}" bash -c "$remote_command"
|
||||
sudo -u "$CFG_DOCKER_INSTALL_USER" env --chdir="$run_cwd" "${run_env[@]}" bash -c "$remote_command"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user