From 6e1ce5ab6c38f9085afbac2f3da8e9a988833fe8 Mon Sep 17 00:00:00 2001 From: Jack May Date: Fri, 10 Apr 2020 15:44:24 -0700 Subject: [PATCH] Safer cargo command (#9437) --- sdk/bpf/scripts/install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk/bpf/scripts/install.sh b/sdk/bpf/scripts/install.sh index 377f433698..bbb8817760 100755 --- a/sdk/bpf/scripts/install.sh +++ b/sdk/bpf/scripts/install.sh @@ -36,7 +36,12 @@ download() { # Install xargo ( set -ex - cargo +"${rust_stable:-}" install xargo + # shellcheck disable=SC2154 + if [[ -n $rust_stable ]]; then + cargo +"$rust_stable" install xargo + else + cargo install xargo + fi xargo --version > xargo.md 2>&1 ) # shellcheck disable=SC2181