Avoid exiting when cmd is not found

This commit is contained in:
Michael Vines 2018-11-30 20:43:25 -08:00
parent 801df72680
commit 42dc18ddfc
No known key found for this signature in database
GPG Key ID: 33F4FDEC4E0E88BD
1 changed files with 2 additions and 0 deletions

View File

@ -16,8 +16,10 @@ maybe_cargo_install() {
crate=$cmd
fi
set +e
"$cmd" --help > /dev/null 2>&1
declare exitcode=$?
set -e
if [[ $exitcode -ne 0 ]]; then
_ cargo install "$crate"
fi