diff options
author | Damian Rouson <damian@sourceryinstitute.org> | 2021-04-07 13:04:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-07 22:04:53 +0200 |
commit | b15db3c999b9cd7dceaa2ac55960ea92d198355b (patch) | |
tree | ea37ad03184b7dc28abcd3d295577bbfa892e38c | |
parent | d9dc9f2ae5f196c15a7d35cddabc805c40ff86ce (diff) | |
download | fpm-b15db3c999b9cd7dceaa2ac55960ea92d198355b.tar.gz fpm-b15db3c999b9cd7dceaa2ac55960ea92d198355b.zip |
feat(install.sh): use wget if curl is missing (#429)
-rwxr-xr-x | install.sh | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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" |