]> git.donarmstrong.com Git - zsh.git/blob - .zsh/zshenv/01_path
add ~/.local/bin to PATH
[zsh.git] / .zsh / zshenv / 01_path
1 # -*- mode: sh -*-
2 # zprofile/00_path
3 #
4 # Adds custom directories to the $PATH
5 #
6 # Copyright © 1994–2008 martin f. krafft <madduck@madduck.net>
7 # Released under the terms of the Artistic Licence 2.0
8 #
9 # Source repository: git://git.madduck.net/etc/zsh.git
10 #
11
12 __prepend_dir_to_path()
13 {
14   local dir
15   for dir; do
16     case "$PATH" in
17       "*:${dir}:*"|"${dir}:*"|"*:${dir}") :;;
18       *) test -d "$dir" && path=("$dir" $path);;
19     esac
20   done
21 }
22
23 __append_dir_to_path()
24 {
25   local dir
26   for dir; do
27     case "$PATH" in
28       "*:${dir}:*"|"${dir}:*"|"*:${dir}") :;;
29       *) test -d "$dir" && path+="$dir";;
30     esac
31   done
32 }
33
34 __prepend_dir_to_path ~/.local/bin
35 __prepend_dir_to_path $BINDIR
36 __prepend_dir_to_path /var/list/.bin
37
38 # vim:ft=zsh