Last active
February 5, 2018 11:05
-
-
Save massich/f382ec0181ce6603b38208f9dec3e4d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script installs Travis helper functions and tools used in openmeeg repositories | |
# | |
# To use them, add the following lines in .travis.yml: | |
# - export DL_DIR=$HOME/downloads # Export the path where to store downloaded files | |
# - curl -fsSkL https://gist.github.com/massich/f382ec0181ce6603b38208f9dec3e4d4/raw > x.sh && source ./x.sh | |
function _download() { | |
url="$1"; f="${2:-$(basename $url)}"; | |
if [ ! -e $DL_DIR/$f ] ; then | |
mkdir -p $DL_DIR ; | |
echo "Downloading: ${DL_DIR}/$f" ; | |
travis_retry wget --no-verbose $url -O $DL_DIR/$f ; | |
else | |
echo "Reading from cache: ${DL_DIR}/$f" ; | |
fi | |
} | |
function download() { _download "$1" "" ; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment