| 1234567891011121314151617181920212223242526272829 |
- # Optimized PATH setup - combine all additions into single operation
- # Build PATH array and export once (faster than multiple exports)
- local new_path_dirs=(
- "/usr/local/texlive/2024/bin/x86_64-linux"
- "$HOME/.local/bin"
- "$HOME/.bin"
- "$HOME/.dotnet/tools"
- "$HOME/.local/share/npm/bin"
- "$HOME/.local/share/cargo/bin"
- "$HOME/.local/share/go/bin"
- "$HOME/.local/share/flatpak/exports/share"
- "$HOME/AppImages/"
- "/var/lib/flatpak/exports/share"
- )
- # Build PATH only with directories that exist (single loop, single export)
- local new_path=""
- for dir in "${new_path_dirs[@]}"; do
- [[ -d "$dir" ]] && new_path="${new_path:+$new_path:}$dir"
- done
- # Export PATH once if we have additions
- [[ -n "$new_path" ]] && export PATH="$new_path:$PATH"
- # Set MANPATH and INFOPATH if texlive directory exists
- [[ -d "/usr/local/texlive/2024/texmf-dist/doc/man" ]] && {
- export MANPATH="/usr/local/texlive/2024/texmf-dist/doc/man:${MANPATH:-}"
- export INFOPATH="/usr/local/texlive/2024/texmf-dist/doc/info:${INFOPATH:-}"
- }
|