mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-20 01:24:42 +04:00
Oops, this wrote a hash.txt file to the working dir
This commit is contained in:
parent
50fe51fc4f
commit
c79bc2eb8e
1 changed files with 15 additions and 14 deletions
|
|
@ -1,26 +1,27 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# This is a script used in travis-ci to install swift
|
# This is a script used in travis-ci to install swift
|
||||||
set -ex
|
set -euxo pipefail
|
||||||
|
|
||||||
. /etc/lsb-release
|
. /etc/lsb-release
|
||||||
if [ "$DISTRIB_CODENAME" = "trusty" ]; then
|
if [ "$DISTRIB_CODENAME" = "trusty" ]; then
|
||||||
SWIFT_TARBALL="swift-4.0.3-RELEASE-ubuntu14.04.tar.gz"
|
SWIFT_URL='https://swift.org/builds/swift-4.0.3-release/ubuntu1404/swift-4.0.3-RELEASE/swift-4.0.3-RELEASE-ubuntu14.04.tar.gz'
|
||||||
SWIFT_HASH="dddb40ec4956e4f6a3f4532d859691d5d1ba8822f6e8b4ec6c452172dbede5ae"
|
SWIFT_HASH="dddb40ec4956e4f6a3f4532d859691d5d1ba8822f6e8b4ec6c452172dbede5ae"
|
||||||
SWIFT_URL="https://swift.org/builds/swift-4.0.3-release/ubuntu1404/swift-4.0.3-RELEASE/$SWIFT_TARBALL"
|
|
||||||
else
|
else
|
||||||
SWIFT_TARBALL="swift-4.0.3-RELEASE-ubuntu16.04.tar.gz"
|
SWIFT_URL='https://swift.org/builds/swift-4.0.3-release/ubuntu1604/swift-4.0.3-RELEASE/swift-4.0.3-RELEASE-ubuntu16.04.tar.gz'
|
||||||
SWIFT_HASH="9adf64cabc7c02ea2d08f150b449b05e46bd42d6e542bf742b3674f5c37f0dbf"
|
SWIFT_HASH="9adf64cabc7c02ea2d08f150b449b05e46bd42d6e542bf742b3674f5c37f0dbf"
|
||||||
SWIFT_URL="https://swift.org/builds/swift-4.0.3-release/ubuntu1604/swift-4.0.3-RELEASE/$SWIFT_TARBALL"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "$HOME"/.swift
|
check() {
|
||||||
pushd "$HOME"/.swift
|
echo "$SWIFT_HASH $TGZ" | sha256sum --check
|
||||||
wget -N -c "$SWIFT_URL"
|
}
|
||||||
echo "$SWIFT_HASH $SWIFT_TARBALL" > hash.txt
|
|
||||||
shasum -a 256 -c hash.txt
|
TGZ="$HOME/.swift/swift.tar.gz"
|
||||||
popd
|
mkdir -p "$(dirname "$TGZ")"
|
||||||
|
if ! check >& /dev/null; then
|
||||||
|
rm -f "$TGZ"
|
||||||
|
curl --location --silent --output "$TGZ" "$SWIFT_URL"
|
||||||
|
check
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p /tmp/swift
|
mkdir -p /tmp/swift
|
||||||
pushd /tmp/swift
|
tar -xf "$TGZ" --strip 1 --directory /tmp/swift
|
||||||
tar -xf "$HOME"/.swift/"$SWIFT_TARBALL" --strip 1
|
|
||||||
popd
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue