aboutsummaryrefslogtreecommitdiffstats
path: root/.zsh.before
diff options
context:
space:
mode:
authorDavid Runge <david.runge@native-instruments.de>2019-05-06 10:39:09 +0200
committerDavid Runge <david.runge@native-instruments.de>2019-05-06 10:39:09 +0200
commit31127226a5dd98b43203e1cec15562100e59da78 (patch)
treea95f7fd6cb7f09fc41295dc7a51b8e11152fb745 /.zsh.before
parentb5ada7f15fe83fbf80642ed18f1c94a38b6a885c (diff)
downloaddotfiles-31127226a5dd98b43203e1cec15562100e59da78.tar.gz
dotfiles-31127226a5dd98b43203e1cec15562100e59da78.tar.bz2
dotfiles-31127226a5dd98b43203e1cec15562100e59da78.tar.xz
dotfiles-31127226a5dd98b43203e1cec15562100e59da78.zip
.zsh.before/path.zsh: Simplify PATH setup by using ternary expressions.
Diffstat (limited to '.zsh.before')
-rw-r--r--.zsh.before/path.zsh22
1 files changed, 10 insertions, 12 deletions
diff --git a/.zsh.before/path.zsh b/.zsh.before/path.zsh
index 146943d..f19b704 100644
--- a/.zsh.before/path.zsh
+++ b/.zsh.before/path.zsh
@@ -1,13 +1,11 @@
-# prepend pyenv based python, in case there's any
-if [ -d "$HOME/.local/bin" ] && [ -d "$HOME/.pyenv/shims" ]; then
- PATH="$HOME/.local/bin:$HOME/.pyenv/shims:$PATH"
-fi
-
-## RASPBERRY PI
-if [[ "$HOST" == *pitheunlord* ]]; then
- PATH=$PATH:"/opt/vc/bin:/opt/vc/sbin"
-fi
-
-# Prepend $HOME/bin and append /usr/sbin to PATH (for Debilian)
-PATH="$HOME/bin:$PATH:/usr/sbin"
+# pyenv
+[ -d "${HOME}/.local/bin" ] && PATH="${HOME}/.local/bin:${PATH}"
+[ -d "${HOME}/.pyenv/shims" ] && PATH="${HOME}/.pyenv/shims:${PATH}"
+# RPi
+[ -d "/opt/vc/bin" ] && PATH="${PATH}:/opt/vc/bin"
+[ -d "/opt/vc/sbin" ] && PATH="${PATH}:/opt/vc/sbin"
+# user bin
+[ -d "${HOME}/bin" ] && PATH="${HOME}/bin:${PATH}"
+# Debilian
+[ -d "/usr/sbin" ] && [ ! -L "/usr/sbin" ] && PATH="${PATH}:/usr/sbin"