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:' echo 'Please enter the path you would like to benchmark:'
if [ -z ${FILE+x} ]; then if [ -z ${FILE+x} ]; then
read input read -r input
else else
input=$FILE input=$FILE
fi fi

View file

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

View file

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

View file

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