From 62706f39e85ae37b2f7f6e5ac2d38371569266cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Fri, 16 Apr 2021 09:14:05 -0700 Subject: [PATCH] Vendor swiftenv installation script --- .travis.yml | 4 ++-- scripts/install_swiftenv.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100755 scripts/install_swiftenv.sh diff --git a/.travis.yml b/.travis.yml index 2a81122a..44895893 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ language: generic sudo: required dist: trusty env: - - SWIFT_VERSION=5.0 + - SWIFT_VERSION=5.0 SWIFTENV_ROOT="$HOME/.swiftenv" PATH="$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims:$PATH" install: - - eval "$(curl -sL https://swiftenv.fuller.li/install.sh)" + - ./scripts/install_swiftenv.sh script: - swift build diff --git a/scripts/install_swiftenv.sh b/scripts/install_swiftenv.sh new file mode 100755 index 00000000..36427b13 --- /dev/null +++ b/scripts/install_swiftenv.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# Automatically installs swiftenv and run's swiftenv install. +# This script was designed for usage in CI systems. + +git clone --depth 1 https://github.com/kylef/swiftenv.git ~/.swiftenv +export SWIFTENV_ROOT="$HOME/.swiftenv" +export PATH="$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims:$PATH" + +if [ -f ".swift-version" ] || [ -n "$SWIFT_VERSION" ]; then + swiftenv install -s +else + swiftenv rehash +fi +