Add command line option to skip map download; switch to wget

Signed-off-by: David Gekeler <git@davidgekeler.eu>
This commit is contained in:
David Gekeler
2025-05-24 01:32:16 +02:00
committed by gekeleda
parent f2d87979d1
commit 871860d53a
2 changed files with 34 additions and 2 deletions

View File

@@ -3,8 +3,31 @@
# Please run this script to configure the repository after cloning it.
#
SKIP_MAP_DOWNLOAD=false
############################# PROCESS OPTIONS ################################
TEMP=$(getopt -o s --long skip-map-download \
-n 'configure' -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$TEMP"
while true; do
case "$1" in
-s | --skip-map-download ) SKIP_MAP_DOWNLOAD=true; shift ;;
* ) break ;;
esac
done
# Shift the processed options away
shift $((OPTIND-1))
set -euo pipefail
###############################################################################
echo "Configuring the repository for development."
if [ ! -d 3party/boost/tools ]; then
@@ -14,6 +37,15 @@ pushd 3party/boost/
./bootstrap.sh
./b2 headers
popd
curl -C - -L --parallel --parallel-immediate --parallel-max 2 https://cdn.comaps.app/maps/latest/World.mwm -o data/World.mwm https://cdn.comaps.app/maps/latest/WorldCoasts.mwm -o data/WorldCoasts.mwm
if [ "$SKIP_MAP_DOWNLOAD" = false ]; then
echo "Downloading world map..."
wget -N https://cdn.comaps.app/maps/latest/World.mwm -P ./data/
wget -N https://cdn.comaps.app/maps/latest/WorldCoasts.mwm -P ./data/
else
echo "Skipping world map download..."
fi
bash ./tools/unix/generate_symbols.sh
echo "The repository is configured for development."