commit d4f558e385fd9e3f757278653d22290c3816c39e parent 4002a84ffe97480b6bd67cbfb9c65d19457f41fe Author: Nick Mathewson <nickm@torproject.org> Date: Wed, 5 Dec 2018 09:02:49 -0500 Merge remote-tracking branch 'tor-github/pr/531' Diffstat:
| A | changes/ticket28012 | | | 3 | +++ |
| M | scripts/maint/updateRustDependencies.sh | | | 18 | +++++++++--------- |
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/changes/ticket28012 b/changes/ticket28012 @@ -0,0 +1,3 @@ + o Code simplification and refactoring: + - Fix issues that shellcheck found in updateRustDependencies.sh. + Resolves ticket 28012. diff --git a/scripts/maint/updateRustDependencies.sh b/scripts/maint/updateRustDependencies.sh @@ -20,26 +20,26 @@ set -e -HERE=`dirname $(realpath $0)` -TOPLEVEL=`dirname $(dirname $HERE)` +HERE=$(dirname "$(realpath "$0")") +TOPLEVEL=$(dirname "$(dirname "$HERE")") TOML="$TOPLEVEL/src/rust/Cargo.toml" VENDORED="$TOPLEVEL/src/ext/rust/crates" -CARGO=`which cargo` +CARGO=$(command -v cargo) if ! test -f "$TOML" ; then - printf "Error: Couldn't find workspace Cargo.toml in expected location: %s\n" "$TOML" + printf "Error: Couldn't find workspace Cargo.toml in expected location: %s\\n" "$TOML" fi if ! test -d "$VENDORED" ; then - printf "Error: Couldn't find directory for Rust dependencies! Expected location: %s\n" "$VENDORED" + printf "Error: Couldn't find directory for Rust dependencies! Expected location: %s\\n" "$VENDORED" fi if test -z "$CARGO" ; then - printf "Error: cargo must be installed and in your \$PATH\n" + printf "Error: cargo must be installed and in your \$PATH\\n" fi -if test -z `cargo --list | grep vendor` ; then - printf "Error: cargo-vendor not installed\n" +if test -z "$(cargo --list | grep vendor)" ; then + printf "Error: cargo-vendor not installed\\n" fi -$CARGO vendor -v --locked --explicit-version --no-delete --sync $TOML $VENDORED +$CARGO vendor -v --locked --explicit-version --no-delete --sync "$TOML" "$VENDORED"