diff options
| author | Mitsuo Tokumori <[email protected]> | 2023-11-24 16:17:47 -0500 |
|---|---|---|
| committer | Mitsuo Tokumori <[email protected]> | 2023-11-24 16:17:47 -0500 |
| commit | 8342f7b3e776ebc482ba87723ba40015d2dab64e (patch) | |
| tree | ee0be339d9641cbd748d19fc5fedec5bd2f8f720 /config/bash/bashrc | |
| parent | dbf6639677796336bdb345efb70736d29c44f60f (diff) | |
| download | dotfiles-8342f7b3e776ebc482ba87723ba40015d2dab64e.tar.gz dotfiles-8342f7b3e776ebc482ba87723ba40015d2dab64e.tar.bz2 dotfiles-8342f7b3e776ebc482ba87723ba40015d2dab64e.zip | |
Fix bug that appended paths multiple times in PATH
Diffstat (limited to 'config/bash/bashrc')
| -rw-r--r-- | config/bash/bashrc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/config/bash/bashrc b/config/bash/bashrc index 7f0abff..4d5178f 100644 --- a/config/bash/bashrc +++ b/config/bash/bashrc @@ -78,12 +78,17 @@ PS1='\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1 # Environment # =========== -# FIXME: This is executed twice. One just after login (first bash) in tty. And -# again then again in the terminal emulator. -PATH="$HOME/.local/bin:$PATH" -PATH="$HOME/mahcode/bin:$PATH" -PATH="$HOME/code/tex-live-native/build/bin/x86_64-linux:$PATH" -export PATH +# Add directories to PATH +ds=( + "$HOME/code/tex-live-native/build/bin/x86_64-linux" + "$HOME/.local/bin" + "$HOME/mahcode/dotfiles/local/bin" +) +for d in "${ds[@]}"; do + if ! echo $PATH | grep -qE "(^|:)$d($|:)"; then + export PATH="$d:$PATH" + fi +done export MANPATH="$HOME/code/tex-live-native/build/texmf-dist/doc/man:$MANPATH" export INFOPATH="$HOME/code/tex-live-native/build/texmf-dist/doc/man:$INFOPATH" |
