From 079ea91d6fb2e263b6a526a61afde2c402f8003b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 9 Oct 2020 22:29:47 +0000 Subject: [PATCH] Add convenience script for working in stability branches (#12765) (#12772) * Add convenience script for working in stability branches * Update scripts/curgo.sh Co-authored-by: Michael Vines * re{locate,name} to /cargo Co-authored-by: Michael Vines (cherry picked from commit ed95071c276a67936defb0ccc391544543d11f73) Co-authored-by: Trent Nelson --- cargo | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 cargo diff --git a/cargo b/cargo new file mode 100755 index 0000000000..5c882eeebf --- /dev/null +++ b/cargo @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# shellcheck source=ci/rust-version.sh +here=$(dirname "$0") + +source "${here}"/ci/rust-version.sh all + +toolchain= +case "$1" in + stable) + # shellcheck disable=SC2054 # rust_stable is sourced from rust-version.sh + toolchain="$rust_stable" + shift + ;; + nightly) + # shellcheck disable=SC2054 # rust_nightly is sourced from rust-version.sh + toolchain="$rust_nightly" + shift + ;; + *) + # shellcheck disable=SC2054 # rust_stable is sourced from rust-version.sh + toolchain="$rust_stable" + ;; +esac + +set -x +exec cargo "+${toolchain}" "${@}"