forked from locationtech/geotrellis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgt-tool
executable file
·40 lines (33 loc) · 1.1 KB
/
gt-tool
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
## replace this with the main class of the method
mainClass="geotrellis.run.Tasks"
version="0.6"
jar_name="geotrellis-tasks-assembly-0.9.0-SNAPSHOT.jar"
java_args=""
jar_url="http://207.245.89.238/jars/"$jar_name
# find jar either in target (we're in SBT)
# or in the same directory as this script (we're both in /bin)
sbt_path="target/scala-2.10/"$jar_name
bin_path=`dirname $0`/$jar_name
geotrellis_dir=$HOME/.geotrellis/
geotrellis_lib_dir=$geotrellis_dir/lib
home_path=$geotrellis_lib_dir/$jar_name
if [ -e $sbt_path ]; then
jar_path=$sbt_path;
elif [ -e $bin_path ]; then
jar_path=$bin_path;
else
if [ -e $home_path ]; then
jar_path=$home_path;
else
echo " ** As this is the first time a geotrellis script has been run"
echo " ** under this account, the geotrellis library will first be"
echo " ** downloaded to "$geotrellis_dir
echo
mkdir -p $geotrellis_lib_dir
wget --progress=bar:force -P $geotrellis_lib_dir $jar_url
jar_path=$geotrellis_lib_dir"/"$jar_name
echo " ** GeoTrellis libraries downloaded."
fi
fi
java $java_args -cp $jar_path $mainClass "$@"