aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sh/.profile
diff options
context:
space:
mode:
Diffstat (limited to 'sh/.profile')
-rw-r--r--sh/.profile16
1 files changed, 8 insertions, 8 deletions
diff --git a/sh/.profile b/sh/.profile
index 2b794d7..0b1d175 100644
--- a/sh/.profile
+++ b/sh/.profile
@@ -3,13 +3,13 @@
# Most of this script is a user scoped version of /etc/profile
-# Append "$1" to $PATH when not already in.
+# Prepend "$1" to $PATH when not already in.
# This function API is accessible to scripts in $XDG_CONFIG_HOME/profile.d
-append_path() {
+prepend_path() {
case ":$PATH:" in
*:"$1":*) ;;
*)
- PATH="${PATH:+$PATH:}$1"
+ PATH="$1${PATH:+:$PATH}"
;;
esac
}
@@ -21,11 +21,6 @@ for generator in /usr/lib/systemd/user-environment-generators/*; do
export $($generator | xargs)
done
-append_path "$HOME/.local/bin"
-
-# Force PATH to be environment
-export PATH
-
# Load profiles from $XDG_CONFIG_HOME/profile.d
if test -d "$XDG_CONFIG_HOME"/profile.d/; then
for profile in "$XDG_CONFIG_HOME"/profile.d/*.sh; do
@@ -34,5 +29,10 @@ if test -d "$XDG_CONFIG_HOME"/profile.d/; then
unset profile
fi
+prepend_path "$HOME/.local/bin"
+
+# Force PATH to be environment
+export PATH
+
# Unload our profile API functions
unset -f append_path