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
17
.setpath.sh
17
.setpath.sh
|
@ -1,6 +1,11 @@
|
||||||
BIN_PATH="$HOME/.local/bin"
|
add_path() {
|
||||||
if [ -d "$BIN_PATH" ]; then
|
BIN_PATH="$1"
|
||||||
found=$(echo $PATH | tr ':' '\n' | grep -w "$BIN_PATH")
|
if [ -d "$BIN_PATH" ]; then
|
||||||
[ ! "$found" ] && export PATH="$BIN_PATH:$PATH"
|
found=$(echo $PATH | tr ':' '\n' | grep -w "$BIN_PATH")
|
||||||
true
|
[ ! "$found" ] && export PATH="$BIN_PATH:$PATH"
|
||||||
fi
|
true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
add_path "$HOME/.local/bin"
|
||||||
|
add_path "$HOME/.cargo/bin"
|
||||||
|
|
Loading…
Reference in a new issue