aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-05-11 15:33:45 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-05-11 15:33:45 -0500
commit18f1079aad39bc4ad49bf9a4f7efe76e97fbdb9a (patch)
treee52b1f9d92037dd7d3946f160f08dcc8ce248f54
parent743bc6ea2df5462c742bbb51730e0edfd5ed5ce9 (diff)
fix(sh): clean up .profile a bit
-rw-r--r--sh/.profile8
1 files changed, 5 insertions, 3 deletions
diff --git a/sh/.profile b/sh/.profile
index 4ecea62..c311d4f 100644
--- a/sh/.profile
+++ b/sh/.profile
@@ -15,7 +15,7 @@ append_path() {
}
# Store original (system) paths to fix prioritization later
-orig_path=$PATH
+_path=$PATH
# Use systemd-environment-d-generator(8) to generate environment, and export those variables
#
@@ -41,5 +41,7 @@ fi
unset -f append_path
# Fix PATH to prioritize user added paths
-PATH="${PATH#"$orig_path":}"${orig_path:+:$orig_path}
-export PATH
+if [ -e "$_path" ]; then
+ PATH="${PATH#"$_path"}:$_path"
+ export PATH
+fi