#!/bin/sh if command -v curl >/dev/null 2>&1; then _downloader=curl elif command -v wget >/dev/null 2>&1; then _downloader=wget else echo "Error: you need to have either 'curl' or 'wget' installed and in your path" exit 1 fi _url="https://install.spacetimedb.com/install-script.sh" _tmpfile=$(mktemp) if [ "$_downloader" = curl ] ; then curl $_url > ${_tmpfile} elif [ "$_downloader" = wget ] ; then wget -q -O - $_url > $_tmpfile fi chmod +x $_tmpfile if [ ! -t 0 ]; then if [ ! -t 1 ]; then echo "Unable to run interactively." exit 1 fi "$_tmpfile" "$@" < /dev/tty else "$_tmpfile" "$@" fi rm -f $_tmpfile