Skip to content

Commit

Permalink
Shellcheck (Unimatrix0#23)
Browse files Browse the repository at this point in the history
* Use ${var:?} to ensure this never expands to /* .
https://github.com/koalaman/shellcheck/wiki/SC2115

* Quote this to prevent word splitting
https://github.com/koalaman/shellcheck/wiki/SC2046
  • Loading branch information
nemchik authored and Unimatrix0 committed Mar 13, 2018
1 parent ae47c73 commit 0a0c0c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions update_ombi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ unzip-strip() (
cp -r "$temp"/*/* "$dest"
else
cp -r "$temp"/* "$dest"
fi && rm -rf "$temp"/* "$temp"
fi && rm -rf "${temp:?}"/* "$temp"
)

# Import any custom config to override the defaults, if necessary
Expand Down Expand Up @@ -222,7 +222,7 @@ tempdir=$(mktemp -d)
file="$tempdir/ombi_$version.tar.gz"
wget --quiet --show-progress -O $file "https://ci.appveyor.com/api/buildjobs/$jobId/artifacts/$filename"
.log 6 "Version $version downloaded...checking file size..."
if [ $(wc -c < $file) != $size ]; then
if [ "$(wc -c < $file)" != $size ]; then
.log 3 "Downloaded file size does not match expected file size...bailing!"
exit 2
fi
Expand Down Expand Up @@ -321,7 +321,7 @@ else
fi

.log 6 "Cleaning up..."
rm -rf "$tempdir"/* "$tempdir"
rm -rf "${tempdir:?}"/* "$tempdir"
declare -i elapsedtime=$SECONDS
declare -i minutes=0
declare -i seconds=0
Expand Down

0 comments on commit 0a0c0c4

Please sign in to comment.