X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/d2ff023f7d000c60f774beccd57cb652977b7279..1b92289b17509336e85613d96bfdef8827c3465c:/.zsh/zprofile/00_path diff --git a/.zsh/zprofile/00_path b/.zsh/zprofile/00_path deleted file mode 120000 index 520b124..0000000 --- a/.zsh/zprofile/00_path +++ /dev/null @@ -1 +0,0 @@ -../zshrc/00_path \ No newline at end of file diff --git a/.zsh/zprofile/00_path b/.zsh/zprofile/00_path new file mode 100644 index 0000000..230e94f --- /dev/null +++ b/.zsh/zprofile/00_path @@ -0,0 +1,34 @@ +# zprofile/00_path +# +# Adds custom directories to the $PATH +# +# Copyright © 1994–2008 martin f. krafft +# Released under the terms of the Artistic Licence 2.0 +# +# Source repository: http://git.madduck.net/v/etc/zsh.git +# + +__prepend_dir_to_path() +{ + for dir; do + case "$PATH" in + "*:${dir}:*"|"${dir}:*"|"*:${dir}") :;; + *) test -d "$dir" && path=("$dir" $path);; + esac + done +} + +__append_dir_to_path() +{ + for dir; do + case "$PATH" in + "*:${dir}:*"|"${dir}:*"|"*:${dir}") :;; + *) test -d "$dir" && path+="$dir";; + esac + done +} + +__prepend_dir_to_path $BINDIR +__append_dir_to_path /usr/lib/surfraw + +# vim:ft=zsh