aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2019-05-19 21:46:50 +0200
committerDavid Runge <dave@sleepmap.de>2019-05-19 21:46:50 +0200
commitc0ca853cc7d463449f86035c6f89f8d859116860 (patch)
tree034c9e2858b040bc84a57b6873a5a291ccccf23a
parentabff00fd019ec877f73e23936e7fcf34c68e4259 (diff)
parent31127226a5dd98b43203e1cec15562100e59da78 (diff)
downloaddotfiles-c0ca853cc7d463449f86035c6f89f8d859116860.tar.gz
dotfiles-c0ca853cc7d463449f86035c6f89f8d859116860.tar.bz2
dotfiles-c0ca853cc7d463449f86035c6f89f8d859116860.tar.xz
dotfiles-c0ca853cc7d463449f86035c6f89f8d859116860.zip
Merge branch 'master' of sleepmap.de:config/dotfiles
* 'master' of sleepmap.de:config/dotfiles: .zsh.before/path.zsh: Simplify PATH setup by using ternary expressions.
-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"