-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtagsoup.sh
executable file
·35 lines (31 loc) · 895 Bytes
/
tagsoup.sh
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
#!/usr/bin/env sh
#See http://mercury.ccil.org/~cowan/XML/tagsoup/
#Internal variables
_thisDir=`dirname "$0"`
_libDir=$( cd "$_thisDir/../lib"; pwd )
_tagsoupDir="$_libDir/tagsoup-1.2.1"
#Check setup
if [ ! `which java 2> /dev/null` ]; then
echo "Error: Could not find java" > /dev/stderr
return
fi
if [ ! -d "$_libDir" ]; then
echo "Error: Could not find \"$_libDir\"" > /dev/stderr
return
fi
if [ ! -d "$_tagsoupDir" ] || [ ! -s "$_tagsoupDir/tagsoup-1.2.1.jar" ]; then
echo "Error: Could not find \"$_tagsoupDir/tagsoup-1.2.1.jar\"" > /dev/stderr
return
fi
#Execute tagsoup using its command line intereface.
#If no parameters passed, then execute with -h so help can be viewed
#Otherwise,execute with parameters passed
if [ -z "$*" ]; then
java \
-jar "$_tagsoupDir/tagsoup-1.2.1.jar" \
--help
else
java \
-jar "$_tagsoupDir/tagsoup-1.2.1.jar" \
"$@"
fi