Skip to content

Commit

Permalink
Check for dependencies before starting.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreisner committed Jul 6, 2011
1 parent caf1021 commit 0859082
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mlbam/spider
Expand Up @@ -118,6 +118,21 @@ fetchfile() {
(( downloads % 10 == 0 )) && sleep 1
}

check_dependencies(){
xmllint --version > /dev/null 2>&1
if [ $? -gt 0 ]; then
echo "xmllint not found, please install it (on Ubuntu: sudo apt-get install libxml2-utils)."
exit 1
fi
curl --version > /dev/null 2>&1
if [ $? -gt 0 ]; then
echo "curl not found, please install it (on Ubuntu: sudo apt-get install curl)."
exit 1
fi
}

check_dependencies

year=$(date +%Y)
league=mlb
previous=
Expand Down

0 comments on commit 0859082

Please sign in to comment.