Verified Commit b2fda849 authored by Aral Balkan's avatar Aral Balkan
Browse files

Closes #140: install script on Linux-likes can now use wget or curl

(Depending on which is present.)
parent f51e8ffa
......@@ -12,12 +12,14 @@ This release implements a lot of small improvements, some of which have been lon
#### General:
- Running `site` without specifying a path while inside a special subfolder of your site (`.dynamic`, `.hugo`, `.wildcard`, `.db`) now magically does the right thing and serves the site root instead of the folder you’re in. If you really do want to serve one of these folders or a subfolder thereof, specifically state your intent by passing the current folder (`.`) as an argument.
- Running `site` without specifying a path while inside a special subfolder of your site (`.dynamic`, `.hugo`, `.wildcard`, `.db`) now magically does the right thing and serves the site root instead of the folder you’re in. If you really do want to serve one of these folders or a subfolder thereof, specifically state your intent by passing the current folder (`.`) as an argument. (#217)
- Status command now displays daemon details if daemon is enabled (#36).
- Status command now displays statistics URL if daemon is active (#232).
- On Linux-like systems, the installation script now uses wget or curl to download the Site.js binary based on whichever is present (favouring wget), instead of expecting wget to be present and failing if it isn’t (#140).
- Implement shorter custom ssh connection timeout for sync for when the host exists but you are not authorised to connect to it.
Previously, the timeout was the default TCP connection timeout of 120 seconds which would make it look like the process had hanged. The new timeout is 5 seconds, which provides timely feedback.
......
......@@ -23,6 +23,27 @@
#
######################################################################
# Use either wget or curl to download the Site.js binary,
# whichever exists on the system (favour wget).
which wget > /dev/null
if [ $? -eq 0 ]
then
# wget exists, we’ll use that.
download="wget -q"
else
which curl > /dev/null
if [ $? -eq 0 ]
then
# curl exists, we’ll use that.
download="curl -Os"
else
echo
echo " ❌ The installation script needs either wget or curl installed to continue."
echo
exit 1
fi
fi
set -e
function cleanUp {
......@@ -101,13 +122,13 @@ if [[ "$OSTYPE" == "linux-gnu" || "$OSTYPE" == "linux-gnueabihf" ]]; then
cpuArchitecture=`uname -m`
if [[ "$cpuArchitecture" == "x86_64" ]]; then
# Linux on x64.
wget -q "https://sitejs.org/binaries/${releaseChannel}/linux/${binaryVersion}.tar.gz"
$download "https://sitejs.org/binaries/${releaseChannel}/linux/${binaryVersion}.tar.gz"
elif [[ "$cpuArchitecture" == "armv7l" || "$cpuArchitecture" == "armv6l" ]]; then
# Linux on ARM. Tested on Raspberry Pi Zero W (armv6l), 3B+ and 4B (both reporting armv7l).
wget -q "https://sitejs.org/binaries/${releaseChannel}/linux-arm/${binaryVersion}.tar.gz"
$download "https://sitejs.org/binaries/${releaseChannel}/linux-arm/${binaryVersion}.tar.gz"
elif [[ "$cpuArchitecture" == "aarch64" ]]; then
# Linux on ARM64. Tested with Pinebook Pro.
wget -q "https://sitejs.org/binaries/${releaseChannel}/linux-arm64/${binaryVersion}.tar.gz"
$download "https://sitejs.org/binaries/${releaseChannel}/linux-arm64/${binaryVersion}.tar.gz"
else
# Error: unsupported architecture.
echo
......@@ -118,7 +139,7 @@ if [[ "$OSTYPE" == "linux-gnu" || "$OSTYPE" == "linux-gnueabihf" ]]; then
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
curl -Os "https://sitejs.org/binaries/${releaseChannel}/macos/${binaryVersion}.tar.gz"
$download "https://sitejs.org/binaries/${releaseChannel}/macos/${binaryVersion}.tar.gz"
else
# Error: Unsupported operating system.
echo
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment