diff --git a/install.sh b/install.sh index ff1f1c1..d6548fd 100755 --- a/install.sh +++ b/install.sh @@ -183,6 +183,21 @@ EOF fi if [ "$role" = "client" ] || [ "$role" = "both" ]; then + case ":$PATH:" in + *":$bindir:"*) ;; + *) + if [ "$(uname -s)" = "Darwin" ] || [ "$(basename "${SHELL:-}")" = "zsh" ]; then + shell_rc="$HOME/.zshrc" + else + shell_rc="$HOME/.profile" + fi + mkdir -p "$(dirname "$shell_rc")" + if [ ! -f "$shell_rc" ] || ! grep -F "$bindir" "$shell_rc" >/dev/null 2>&1; then + printf '\nexport PATH="%s:$PATH"\n' "$bindir" >>"$shell_rc" + fi + ;; + esac + client_config="$config_dir/client.toml" if [ "$force_config" -eq 1 ] || [ ! -f "$client_config" ]; then default_server="${server:-user@example.com}"