From 7041157a0cf4a61e9b9f7e4b36dbfa5fc4633b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ko=C4=87?= Date: Wed, 21 Sep 2016 19:41:08 +0200 Subject: [PATCH] Check the apps used in get-shapefiles.sh --- get-shapefiles.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/get-shapefiles.sh b/get-shapefiles.sh index da232de4d1..b6fe4cb206 100755 --- a/get-shapefiles.sh +++ b/get-shapefiles.sh @@ -3,6 +3,21 @@ set -e -u UNZIP_OPTS=-qqun +# check essential applications +exists() +{ + command -v "$1" >/dev/null 2>&1 +} + +for application in curl tar unzip; do + if exists $application; then + echo $application 'detected...' + else + echo 'ERROR:' $application 'not detected, you need to install it first!' + exit 1 + fi +done + # create and populate data dir mkdir -p data/ mkdir -p data/world_boundaries