From 4aa7d0603da2c4535b6af4efaf7f74fab3e57216 Mon Sep 17 00:00:00 2001 From: Andrea Rogers Date: Tue, 22 Oct 2024 12:41:12 -0500 Subject: [PATCH] profile: More robust handling of user's cargo PATH --- .profile | 6 +++++- .profile.mac | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index b10d788..5a34f0e 100644 --- a/.profile +++ b/.profile @@ -1,4 +1,8 @@ -[ -f "$HOME/.cargo/env" ] && . "$HOME/.cargo/env" +if [ -f "$HOME/.cargo/env" ]; then + . "$HOME/.cargo/env" +elif [ -d "$HOME/.cargo/bin" ]; then + PATH="$HOME/.cargo/bin:$PATH" +fi if [ -d "$HOME/.profile.d" ]; then for pd in "$HOME/.profile.d"/*; do diff --git a/.profile.mac b/.profile.mac index f036902..b7dfdfd 100644 --- a/.profile.mac +++ b/.profile.mac @@ -16,7 +16,6 @@ export PATH="$HOME/Library/Python/3.12/bin:$HOME/Library/Python/3.11/bin:$HOME/p export PERL5LIB="$HOME/perl5/lib/perl5:$PERL5LIB" eval $(ssh-agent) -. "$HOME/.cargo/env" alias ls='ls -G'