-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_mapcrafter_markers.sh
executable file
·57 lines (50 loc) · 1.04 KB
/
run_mapcrafter_markers.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
##
# This script doesn't read the main configuration file so we are specifying this manually.
# This could be tidied up later; sorry.
MAPCRAFTER_MARKERS_BIN=/home/minecraft/git/mapcrafter/src/mapcrafter_markers
set -e
usage()
{
echo "usage: $0 -w world"
echo ""
echo " -h : This help"
echo " -c : Path to Mapcrafter config"
echo " -v : Verbose mode"
exit 1
}
while getopts "hvc:": arg; do
case $arg in
h)
usage
;;
v)
VERBOSE="-v"
;;
c)
CONFIG=${OPTARG}
;;
esac
done
# Check parameters
if [[ -z ${CONFIG} ]]
then
echo "You need to specify a Mapcrafter configuration file"
echo
usage
exit 1
else
if [ ! -f "$CONFIG" ]; then
echo "ERROR: $CONFIG file does not exist!"
exit 2
fi
fi
function print_debug {
if [[ $DEBUG_MODE == "1" ]]
then
# [ $DEBUG_MODE -eq 1 ] && echo -ne "\033[00;35mDEBUG: $1" && echo -e '\033[0m'
[ $DEBUG_MODE -eq 1 ] && echo -ne "\033[00;35mDEBUG: $1" && echo -e '\033[0m'
fi
}
# Run it
$MAPCRAFTER_MARKERS_BIN $VERBOSE -c $CONFIG