File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change 3737 mvn=' mvn -q -B'
3838fi
3939
40+ command_exists () {
41+ type " $1 " & > /dev/null
42+ }
43+ download () {
44+ if command_exists wget ; then
45+ # -N only redownloads if timestamp/filesize is newer/different
46+ $wget -N --no-check-certificate $1
47+ elif command_exists curl ; then
48+ if ! [ -e ${1##*/ } ]; then
49+ curl $1 -o ${1##*/ }
50+ fi
51+ else
52+ echo ERROR: Could not find wget nor curl.
53+ fi
54+ }
55+
56+
4057# download the default field maps, as defined in bin/env.sh:
4158# (and duplicated in etc/services/reconstruction.yaml):
4259source ` dirname $0 ` /bin/env.sh
4360if [ $downloadMaps == " yes" ]; then
4461 echo ' Retrieving field maps ...'
45- webDir=http ://clasweb.jlab.org/clas12offline/magfield
62+ webDir=https ://clasweb.jlab.org/clas12offline/magfield
4663 locDir=etc/data/magfield
4764 mkdir -p $locDir
4865 cd $locDir
4966 for map in $COAT_MAGFIELD_SOLENOIDMAP $COAT_MAGFIELD_TORUSMAP $COAT_MAGFIELD_TORUSSECONDARYMAP
5067 do
51- # -N only redownloads if timestamp/filesize is newer/different
52- $wget -N --no-check-certificate $webDir /$map
68+ download $webDir /$map
5369 done
5470 cd -
5571fi
You can’t perform that action at this time.
0 commit comments