Skip to content

Commit 6436abd

Browse files
committed
Fix POSIX PATH checks in bash profiles
1 parent 71c5572 commit 6436abd

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

dot_bashrc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
if [ -d "$HOME/.local/bin" ] && [ ":$PATH:" != *":$HOME/.local/bin:"* ]; then
2-
export PATH="$HOME/.local/bin:$PATH"
1+
if [ -d "$HOME/.local/bin" ]; then
2+
case ":$PATH:" in
3+
*":$HOME/.local/bin:"*) ;;
4+
*) export PATH="$HOME/.local/bin:$PATH" ;;
5+
esac
36
fi
47

58
# Bun

dot_profile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
if [ -d "$HOME/.local/bin" ] && [ ":$PATH:" != *":$HOME/.local/bin:"* ]; then
2-
export PATH="$HOME/.local/bin:$PATH"
1+
if [ -d "$HOME/.local/bin" ]; then
2+
case ":$PATH:" in
3+
*":$HOME/.local/bin:"*) ;;
4+
*) export PATH="$HOME/.local/bin:$PATH" ;;
5+
esac
36
fi
47
. "$HOME/.cargo/env"

0 commit comments

Comments
 (0)