Update bootstrap to install Swift on Linux

This commit is contained in:
Sami Samhuri 2019-12-22 14:22:30 -08:00
parent 4626731919
commit bc6fc8bb68
2 changed files with 20 additions and 13 deletions

View file

@ -1,16 +1,23 @@
#!/bin/sh #!/bin/bash
# bail on errors # bail on errors and unset variables
set -e set -euo pipefail
# export PATH="$HOME/.rbenv/shims:$PATH" SWIFT_VERSION=5.1.3
SWIFT_DIR=swift-$SWIFT_VERSION-RELEASE/swift-$SWIFT_VERSION-RELEASE-ubuntu18.04
SWIFT_FILENAME=$SWIFT_DIR.tar.gz
echo "*** bootstrap samhuri.net" if [[ $(uname) = "Linux" ]]; then
if which swiftc >/dev/null 2>/dev/null; then
echo "* bundle install" echo "*** swift is installed: $(swift --version)"
bundle install else
echo "*** installing swift"
# echo "* npm install" pushd $HOME
# npm install 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" echo "*** done"