2018-10-20 18:35:07 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-01-11 07:56:15 +03:00
|
|
|
# If converting one map fails, keep converting other maps.
|
|
|
|
#set -e
|
2018-10-20 18:35:07 +03:00
|
|
|
|
2018-12-20 23:15:58 +03:00
|
|
|
release_mode=""
|
|
|
|
for arg in "$@"; do
|
|
|
|
if [ "$arg" == "--release" ]; then
|
|
|
|
release_mode="--release";
|
|
|
|
else
|
|
|
|
echo "Unknown argument $arg";
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2018-10-20 18:35:07 +03:00
|
|
|
mkdir -p data/maps/
|
|
|
|
|
|
|
|
for map_path in `ls data/raw_maps/`; do
|
|
|
|
map=`basename $map_path .abst`;
|
2019-01-11 07:56:15 +03:00
|
|
|
echo "Precomputing $map with no_edits";
|
|
|
|
cd precompute;
|
2019-01-31 22:31:45 +03:00
|
|
|
RUST_BACKTRACE=1 cargo run $release_mode ../data/raw_maps/$map.abst --edits_name=no_edits;
|
2019-01-11 07:56:15 +03:00
|
|
|
cd ..;
|
|
|
|
|
2018-10-20 18:35:07 +03:00
|
|
|
if [ -e data/edits/$map ]; then
|
|
|
|
# Line based iteration, since filenames might have spaces
|
|
|
|
ls data/edits/$map/ | while read edit_path
|
|
|
|
do
|
|
|
|
edits=`basename "$edit_path" .json`;
|
|
|
|
echo "Precomputing $map with $edits";
|
2018-10-21 21:33:16 +03:00
|
|
|
cd precompute;
|
2019-01-31 22:31:45 +03:00
|
|
|
RUST_BACKTRACE=1 cargo run $release_mode ../data/raw_maps/$map.abst --edits_name="$edits";
|
2018-10-20 18:35:07 +03:00
|
|
|
cd ..;
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
done
|