fix: shellcheck warnings (#663)

SC2086: Double quote to prevent globbing and word splitting.
SC2162: read without -r will mangle backslashes
This commit is contained in:
VeryTastyTomato 2020-11-30 07:56:58 +01:00 committed by GitHub
parent feb0631414
commit e608b7d344
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 13 deletions

View File

@ -22,7 +22,7 @@ echo "The use of this tool requires $REQUIRED to be installed and available in y
echo 'Please enter the path you would like to benchmark:'
if [ -z ${FILE+x} ]; then
read input
read -r input
else
input=$FILE
fi

View File

@ -11,13 +11,12 @@ TARGET_TRIPLE=$2
# $3 {boolean} = Whether or not building for release or not.
RELEASE_BUILD=$3
required_arg $CROSS 'CROSS'
required_arg $TARGET_TRIPLE '<Target Triple>'
required_arg "$CROSS" 'CROSS'
required_arg "$TARGET_TRIPLE" '<Target Triple>'
if [ -z "$RELEASE_BUILD" ]; then
$CROSS build --target $TARGET_TRIPLE
$CROSS build --target $TARGET_TRIPLE --all-features
$CROSS build --target "$TARGET_TRIPLE"
$CROSS build --target "$TARGET_TRIPLE" --all-features
else
$CROSS build --target $TARGET_TRIPLE --all-features --release
$CROSS build --target "$TARGET_TRIPLE" --all-features --release
fi

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -e
rustup default $1
rustup target add $2
rustup default "$1"
rustup target add "$2"

View File

@ -9,8 +9,8 @@ CROSS=$1
# $1 {string} = <Target Triple>
TARGET_TRIPLE=$2
required_arg $CROSS 'CROSS'
required_arg $TARGET_TRIPLE '<Target Triple>'
required_arg "$CROSS" 'CROSS'
required_arg "$TARGET_TRIPLE" '<Target Triple>'
$CROSS test --target $TARGET_TRIPLE
$CROSS build --target $TARGET_TRIPLE --all-features
$CROSS test --target "$TARGET_TRIPLE"
$CROSS build --target "$TARGET_TRIPLE" --all-features