mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
23 lines
622 B
Bash
Executable file
23 lines
622 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# bail on errors and unset variables
|
|
set -euo pipefail
|
|
|
|
SWIFT_VERSION=5.1.3
|
|
SWIFT_DIR=swift-$SWIFT_VERSION-RELEASE/swift-$SWIFT_VERSION-RELEASE-ubuntu18.04
|
|
SWIFT_FILENAME=$SWIFT_DIR.tar.gz
|
|
|
|
if [[ $(uname) = "Linux" ]]; then
|
|
if which swiftc >/dev/null 2>/dev/null; then
|
|
echo "*** swift is installed: $(swift --version)"
|
|
else
|
|
echo "*** installing swift"
|
|
pushd $HOME
|
|
wget https://swift.org/builds/swift-$SWIFT_VERSION-release/ubuntu1804/$SWIFT_FILENAME
|
|
tar xzf $SWIFT_FILENAME
|
|
echo "export PATH=\"\$HOME/$SWIFT_DIR/usr/bin:\$PATH\"" >> $HOME/.bashrc
|
|
popd
|
|
fi
|
|
fi
|
|
|
|
echo "*** done"
|