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
set -e
# bail on errors and unset variables
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"
echo "* bundle install"
bundle install
# echo "* npm install"
# npm install
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"

View file

@ -3,9 +3,9 @@
set -euo pipefail
if [[ $(uname) = "Linux" ]]; then
build_platform_dir="x86_64-unknown-linux"
build_platform_dir="x86_64-unknown-linux"
else
build_platform_dir="x86_64-apple-macosx"
build_platform_dir="x86_64-apple-macosx"
fi
pushd "gensite" >/dev/null