rust-manage.sh: improve pgrep and completion gen
This commit is contained in:
parent
2c0f553087
commit
6b60efabc4
|
@ -7,17 +7,24 @@ if ! command -v rustup > /dev/null; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if pgrep --exact "rust-analyzer|cargo|rustc" > /dev/null; then
|
||||
>&2 echo 'You are probably using components that will be updated, even replaced...'
|
||||
>&2 echo 'Not continuing'
|
||||
exit 1
|
||||
if [ "$(uname -s)" = 'Linux' ]; then
|
||||
if pgrep --exact "rust-analyzer|cargo|rustc" > /dev/null; then
|
||||
>&2 echo 'You are probably using components that will be updated, even replaced...'
|
||||
>&2 echo 'Not continuing'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
rustup default stable
|
||||
rustup update stable
|
||||
rustup component add rust-src rust-analysis rust-analyzer clippy
|
||||
|
||||
if [ ! -d "${HOME}/.config/fish/completions" ]; then
|
||||
if echo "${SHELL}" | grep 'bash' > /dev/null; then
|
||||
mkdir -p "${HOME}/.local/share/bash-completion/completions"
|
||||
rustup completions bash > "${HOME}/.local/share/bash-completion/completions/rustup"
|
||||
rustup completions bash cargo > "${HOME}/.local/share/bash-completion/completions/cargo"
|
||||
elif echo "${SHELL}" | grep 'fish' > /dev/null; then
|
||||
mkdir -p "${HOME}/.config/fish/completions"
|
||||
rustup completions fish > "${HOME}/.config/fish/completions/rustup.fish"
|
||||
rustup completions fish cargo > "${HOME}/.config/fish/completions/cargo.fish"
|
||||
fi
|
||||
rustup completions fish > "${HOME}/.config/fish/completions/rustup.fish"
|
||||
|
|
Loading…
Reference in New Issue