#!/bin/bash # # Convert the EduNetworkBuilder levels from XML to json # Run this from the web directory, and make sure to have xq installed if which xq >/dev/null; then if [ -d Resources -a -d EduResources ]; then for a in EduResources/Level{0,1,2,3,4,5,6}*; do b=$(basename $a | sed 's/.enbx/\.json/'); if [ ! -e Resources/$b ]; then echo $b xq '.' $a > Resources/$b fi done else echo "You must be in the web directory of the EduNetworkBuilder git repo for this to work" fi else echo "xq must be installed. This comes with the jq program" echo "jq is used for working with json files and xq is the counterpart" echo "that converts xml to json." fi