Fixed broken pipe race condition in ensure_installed

This commit is contained in:
Erin Power
2019-09-17 18:53:38 +02:00
committed by Benjamin Bouvier
parent c0274eca24
commit 3c6795decf

View File

@@ -55,7 +55,7 @@ ensure_installed() {
program="$1" program="$1"
toolchain="${2:-stable}" toolchain="${2:-stable}"
if has_toolchain $toolchain; then if has_toolchain $toolchain; then
if cargo +$toolchain install --list | grep -q $program; then if grep -q $program <(cargo +$toolchain install --list); then
echo "$program found" echo "$program found"
else else
echo "installing $program" echo "installing $program"