aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sh/.config/profile.d/20-ruby.sh
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2023-05-24 16:36:32 -0500
committerToby Vincent <tobyv13@gmail.com>2023-05-24 16:36:32 -0500
commitefc827f5a9efc072bd6cd248631e9647d048756f (patch)
treee66537fc5128aca80580fa640546970f3ac187d9 /sh/.config/profile.d/20-ruby.sh
parentc930c1e72e861bb285d77e0ccd3efe48d8f36739 (diff)
fix: prevent PATH from being overridden
Also, mimic Arch's /etc/profile more accurately, switching to append-path API function that is called from auxiliary profile.d scripts.
Diffstat (limited to 'sh/.config/profile.d/20-ruby.sh')
-rw-r--r--sh/.config/profile.d/20-ruby.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/sh/.config/profile.d/20-ruby.sh b/sh/.config/profile.d/20-ruby.sh
index 1336853..757bd95 100644
--- a/sh/.config/profile.d/20-ruby.sh
+++ b/sh/.config/profile.d/20-ruby.sh
@@ -2,5 +2,6 @@
if command -v ruby >/dev/null && command -v gem >/dev/null; then
GEM_USER_DIR="$(ruby -r rubygems -e 'puts Gem.user_dir')"
- export PATH="$PATH:$GEM_USER_DIR"
+ [ -d "$GEM_USER_DIR" ] && append_path "$GEM_USER_DIR"
+ export PATH
fi