Add cargo's bin directory to the $PATH

This commit is contained in:
Rodolphe Breard 2018-04-02 14:28:54 +02:00
parent 2703b34da4
commit 1f86a61f96

View file

@ -1,6 +1,11 @@
BIN_PATH="$HOME/.local/bin"
if [ -d "$BIN_PATH" ]; then
found=$(echo $PATH | tr ':' '\n' | grep -w "$BIN_PATH")
[ ! "$found" ] && export PATH="$BIN_PATH:$PATH"
true
fi
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"