From 18f1079aad39bc4ad49bf9a4f7efe76e97fbdb9a Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Sat, 11 May 2024 15:33:45 -0500 Subject: fix(sh): clean up .profile a bit --- sh/.profile | 8 +++++--- 1 file 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 -- cgit v1.2.3-70-g09d2