Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit 05246d8

Browse files
committed
installer: add $HOME/.local/bin to PATH
1 parent 75ff2b7 commit 05246d8

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

install.sh

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,25 @@ setup_global_command() {
317317
local profile_path
318318
profile_path=$(get_shell_profile "$shell_type")
319319

320-
print_warning "$HOME/.local/bin is not in your PATH"
321-
print_info "Add this line to your shell profile ($(basename "$profile_path")):"
322-
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
323-
print_info "Or run: echo 'export PATH=\"\$HOME/.local/bin:\$PATH\"' >> $profile_path"
320+
print_info "Adding $HOME/.local/bin to PATH in $(basename "$profile_path")"
321+
322+
# Create the file if it doesn't exist
323+
touch "$profile_path"
324+
325+
# Check if PATH export already exists (but isn't active in current session)
326+
if ! grep -q "export PATH.*\.local/bin" "$profile_path"; then
327+
# Add PATH export
328+
{
329+
echo ""
330+
echo "# Add ~/.local/bin to PATH"
331+
echo "export PATH=\"\$HOME/.local/bin:\$PATH\""
332+
} >>"$profile_path"
333+
334+
print_success "Added ~/.local/bin to PATH in $(basename "$profile_path")"
335+
print_info "Restart your terminal or run: source $profile_path"
336+
else
337+
print_success "~/.local/bin PATH export already exists in $(basename "$profile_path")"
338+
fi
324339
else
325340
print_success "$HOME/.local/bin is already in your PATH"
326341
fi

0 commit comments

Comments
 (0)