Add cargo's bin directory to the $PATH
This commit is contained in:
parent
2703b34da4
commit
1f86a61f96
1 changed files with 11 additions and 6 deletions
|
@ -1,6 +1,11 @@
|
|||
BIN_PATH="$HOME/.local/bin"
|
||||
add_path() {
|
||||
BIN_PATH="$1"
|
||||
if [ -d "$BIN_PATH" ]; then
|
||||
found=$(echo $PATH | tr ':' '\n' | grep -w "$BIN_PATH")
|
||||
[ ! "$found" ] && export PATH="$BIN_PATH:$PATH"
|
||||
true
|
||||
fi
|
||||
}
|
||||
|
||||
add_path "$HOME/.local/bin"
|
||||
add_path "$HOME/.cargo/bin"
|
||||
|
|
Loading…
Reference in a new issue