Skip to content

Instantly share code, notes, and snippets.

@arguiot
Created February 19, 2018 12:54
Show Gist options
  • Save arguiot/47e66799e18ad4e76c3c72ea756659c9 to your computer and use it in GitHub Desktop.
Save arguiot/47e66799e18ad4e76c3c72ea756659c9 to your computer and use it in GitHub Desktop.
Install Swift on Ubuntu
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment