From b15db3c999b9cd7dceaa2ac55960ea92d198355b Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Wed, 7 Apr 2021 13:04:53 -0700 Subject: feat(install.sh): use wget if curl is missing (#429) --- install.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 7f3908b..6c51304 100755 --- a/install.sh +++ b/install.sh @@ -52,7 +52,18 @@ if [ -z ${FFLAGS+x} ]; then fi mkdir -p $BOOTSTRAP_DIR -curl -LJ $SOURCE_URL > $BOOTSTRAP_DIR/fpm.f90 + +if command -v curl > /dev/null 2>&1; then + FETCH="curl -L" +elif command -v wget > /dev/null 2>&1; then + FETCH="wget -O -" +else + echo "No download mechanism found. Install curl or wget first." + exit 1 +fi + +$FETCH $SOURCE_URL > $BOOTSTRAP_DIR/fpm.f90 + $FC $FFLAGS -J $BOOTSTRAP_DIR $BOOTSTRAP_DIR/fpm.f90 -o $BOOTSTRAP_DIR/fpm $BOOTSTRAP_DIR/fpm install --compiler "$FC" --flag "$FFLAGS" --prefix "$PREFIX" -- cgit v1.2.3