added getting the latest version by default

This commit is contained in:
Nikita Bykov
2020-03-27 13:55:47 +03:00
parent 01d87333d8
commit 8bf9b15316

View File

@@ -7,9 +7,11 @@
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install # Install
# Install
image_label="$(lsb_release -rs)"
swift_version="5.2"
curl https://swift.org/download/ > /tmp/tmp_file
swift_version=$(cat /tmp/tmp_file | grep -m1 "id=\"swift-" | cut -d'>' -f2 | cut -d'<' -f1 | cut -d' ' -f2)
wget -P /tmp https://swift.org/builds/swift-$swift_version-release/ubuntu${image_label//./}/swift-$swift_version-RELEASE/swift-$swift_version-RELEASE-ubuntu$image_label.tar.gz
tar xzf /tmp/swift-$swift_version-RELEASE-ubuntu$image_label.tar.gz