Skip to content

Commit b15db3c

Browse files
author
Damian Rouson
authored
feat(install.sh): use wget if curl is missing (#429)
1 parent d9dc9f2 commit b15db3c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

install.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,18 @@ if [ -z ${FFLAGS+x} ]; then
5252
fi
5353

5454
mkdir -p $BOOTSTRAP_DIR
55-
curl -LJ $SOURCE_URL > $BOOTSTRAP_DIR/fpm.f90
55+
56+
if command -v curl > /dev/null 2>&1; then
57+
FETCH="curl -L"
58+
elif command -v wget > /dev/null 2>&1; then
59+
FETCH="wget -O -"
60+
else
61+
echo "No download mechanism found. Install curl or wget first."
62+
exit 1
63+
fi
64+
65+
$FETCH $SOURCE_URL > $BOOTSTRAP_DIR/fpm.f90
66+
5667
$FC $FFLAGS -J $BOOTSTRAP_DIR $BOOTSTRAP_DIR/fpm.f90 -o $BOOTSTRAP_DIR/fpm
5768

5869
$BOOTSTRAP_DIR/fpm install --compiler "$FC" --flag "$FFLAGS" --prefix "$PREFIX"

0 commit comments

Comments
 (0)