Skip to content

Commit eace7ab

Browse files
committed
fix(install): prepend ~/.local/bin to PATH in user shells for MOTD runner
1 parent 3c5c003 commit eace7ab

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Scripts/install/install.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,20 @@ path_check_msg() {
151151
install_motd_hooks_user() {
152152
# Install guarded blocks for common shells regardless of current $SHELL
153153
# Bash
154+
# Ensure ~/.local/bin precedes PATH in interactive shells so 'serverutils' resolves in subshells
155+
if ! grep -Fq ">>> SOLEN PATH_USER_LOCAL" "$HOME/.bashrc" 2>/dev/null; then
156+
solen_insert_marker_block "$HOME/.bashrc" \
157+
"# >>> SOLEN PATH_USER_LOCAL (do not edit) >>>" \
158+
"# <<< SOLEN PATH_USER_LOCAL (managed) <<<" \
159+
"$(cat <<'EOS'
160+
# Ensure ~/.local/bin on PATH
161+
if [ -d "$HOME/.local/bin" ]; then
162+
case ":$PATH:" in *":$HOME/.local/bin:"*) ;; *) PATH="$HOME/.local/bin:$PATH";; esac
163+
export PATH
164+
fi
165+
EOS
166+
)"
167+
fi
154168
solen_insert_marker_block "$HOME/.bashrc" \
155169
"# >>> SOLEN MOTD_BASH (do not edit) >>>" \
156170
"# <<< SOLEN MOTD_BASH (managed) <<<" \

0 commit comments

Comments
 (0)