From 31127226a5dd98b43203e1cec15562100e59da78 Mon Sep 17 00:00:00 2001 From: David Runge Date: Mon, 6 May 2019 10:39:09 +0200 Subject: .zsh.before/path.zsh: Simplify PATH setup by using ternary expressions. --- .zsh.before/path.zsh | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to '.zsh.before') 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" -- cgit v1.2.3-54-g00ecf