-echo Starting project build
-$GODOT --headless --export-debug --path $DIR_PROJECT $PLATFORM $DIR_DEBUG/$PLATFORM/wolf-seeking-sheep.dmg
+# iterate through all build types present in config file
+EXPORT_PRESETS_CFG=$DIR_PROJECT/export_presets.cfg
+EXPORT_NAMES=$(awk -F= '$1=="name"{print $2}' $EXPORT_PRESETS_CFG | sed 's/"//g')
+GODOT_OPTS="--headless --path $DIR_PROJECT"
+
+for EXPORT_NAME in $EXPORT_NAMES
+do
+ echo
+ echo Starting project build for export $EXPORT_NAME
+
+ # create build folders
+ [[ -d $DIR_RELEASE/$EXPORT_NAME ]] || mkdir -p $DIR_RELEASE/$EXPORT_NAME
+ [[ -d $DIR_DEBUG/$EXPORT_NAME ]] || mkdir -p $DIR_DEBUG/$EXPORT_NAME
+
+ # get export name from config file
+ EXPORT_FNAME=$(awk -vname=${EXPORT_NAME} -F= \
+ '$1=="name" && $2~name{f=1} f==1 && $1=="export_path"{print $2;exit}' \
+ $EXPORT_PRESETS_CFG | sed -e 's|^.*/||' -e 's/"//g')
+
+ # do build!
+ echo $GODOT $GODOT_OPTS --export-debug "$EXPORT_NAME" $DIR_DEBUG/$EXPORT_NAME/$EXPORT_FNAME
+ $GODOT $GODOT_OPTS --export-debug "$EXPORT_NAME" $DIR_DEBUG/$EXPORT_NAME/$EXPORT_FNAME
+ echo $GODOT $GODOT_OPTS --export-release "$EXPORT_NAME" $DIR_RELEASE/$EXPORT_NAME/$EXPORT_FNAME
+ $GODOT $GODOT_OPTS --export-release "$EXPORT_NAME" $DIR_RELEASE/$EXPORT_NAME/$EXPORT_FNAME
+done