mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
50 lines
1.3 KiB
Bash
Executable file
50 lines
1.3 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# bail on errors and unset variables
|
|
set -euo pipefail
|
|
|
|
SWIFT_VERSION=5.5.2
|
|
SWIFT_DIR=swift-$SWIFT_VERSION-RELEASE-ubuntu20.04
|
|
SWIFT_FILENAME=$SWIFT_DIR.tar.gz
|
|
|
|
if [[ $(uname) = "Linux" ]]; then
|
|
sudo apt install -y \
|
|
binutils \
|
|
git \
|
|
gnupg2 \
|
|
libc6-dev \
|
|
libcurl4 \
|
|
libedit2 \
|
|
libgcc-9-dev \
|
|
libpython2.7 \
|
|
libsqlite3-0 \
|
|
libstdc++-9-dev \
|
|
libxml2 \
|
|
libz3-dev \
|
|
pkg-config \
|
|
tzdata \
|
|
uuid-dev \
|
|
zlib1g-dev
|
|
|
|
if which swift >/dev/null 2>/dev/null && swift --version | grep $SWIFT_VERSION >/dev/null 2>/dev/null; then
|
|
echo "*** swift $SWIFT_VERSION is installed"
|
|
else
|
|
echo "*** installing swift"
|
|
if [[ -e $SWIFT_FILENAME ]]; then
|
|
echo "*** $SWIFT_FILENAME exists, skipping download"
|
|
else
|
|
wget https://swift.org/builds/swift-$SWIFT_VERSION-release/ubuntu2004/swift-$SWIFT_VERSION-RELEASE/$SWIFT_FILENAME
|
|
fi
|
|
if [[ -e $SWIFT_DIR ]]; then
|
|
echo "*** $SWIFT_DIR exists, skipping extraction"
|
|
else
|
|
tar xzf $SWIFT_FILENAME
|
|
fi
|
|
echo "*** add $PWD/$SWIFT_DIR/usr/bin to PATH in your shell's rc file"
|
|
fi
|
|
|
|
echo "*** installing inotify-tools for watch script"
|
|
sudo apt install -y inotify-tools
|
|
fi
|
|
|
|
echo "*** done"
|