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