about summary refs log tree commit diff stats
path: root/profile/path.sh
diff options
context:
space:
mode:
authorCase Duckworth2022-04-13 17:04:46 -0500
committerCase Duckworth2022-04-13 17:04:46 -0500
commit6f30ac188d687522f56b41ebafe7e49c322af038 (patch)
tree9e2253e0883cad1a8b12ce340a19e3b4abf9b0e9 /profile/path.sh
parentCheck for existence of dircolors (diff)
downloadetc-6f30ac188d687522f56b41ebafe7e49c322af038.tar.gz
etc-6f30ac188d687522f56b41ebafe7e49c322af038.zip
Add path_add_unsafe and change path munging
Diffstat (limited to 'profile/path.sh')
-rw-r--r--profile/path.sh30
1 files changed, 0 insertions, 30 deletions
diff --git a/profile/path.sh b/profile/path.sh deleted file mode 100644 index 56bdc39..0000000 --- a/profile/path.sh +++ /dev/null
@@ -1,30 +0,0 @@
1# PATH
2
3# add a path to PATH, but only if it's not already there
4path_add() { # path_add [-a] PATH...
5 # -a appends (default is prepend)
6 APPEND=false
7 if [ "x$1" = "x-a" ]; then
8 APPEND=true
9 shift
10 fi
11
12 for p; do
13 case ":$PATH:" in
14 *:"$p":*) ;;
15 *)
16 if $APPEND; then
17 PATH="$PATH:$p"
18 else
19 PATH="$p:$PATH"
20 fi
21 ;;
22 esac
23 done
24
25 unset APPEND
26}
27
28path_add "$HOME/bin" "$HOME/usr/bin"
29
30command -v luarocks >/dev/null 2>&1 && path_add "$HOME/.luarocks/bin"