Skip to content

Commit

Permalink
Cleaned some changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dirtyhabits97 committed Sep 15, 2021
1 parent 869a152 commit 5b0b4cf
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions ext/swiftlint/downloadSwiftlint.sh
Expand Up @@ -31,21 +31,19 @@ do
shift
done

set -x

### Download
mkdir -p "${destination}"
curl -s -L "${url}" -o "${asset}"

# If macOS
if [[ "$OSTYPE" == "darwin"* ]]; then
resulting_hash=`md5 -q ${asset}`
hash_cmd="md5 -q ${asset}"
# Default to linux
else
resulting_hash=`md5sum ${asset} | awk '{ print $1 }'`
hash_cmd="md5sum ${asset} | awk '{ print $1 }'"
fi

if [[ ! -z "${SWIFTLINT_VERSION}" || "$resulting_hash" == "${default_hash}" ]]; then
### Download
mkdir -p "${destination}"
curl -s -L "${url}" -o "${asset}"

if [[ ! -z "${SWIFTLINT_VERSION}" || `$hash_cmd` == "${default_hash}" ]]; then
# if another version is set || our hardcoded hash is correct
unzip -o -q "${asset}" -d "${destination}"
else
Expand Down

0 comments on commit 5b0b4cf

Please sign in to comment.