#!/bin/sh
CSV=$1
CFG=$2
DIR=$3
LEVEL1=${4:-CVE_ENT}
LEVEL2=${5:-CVE_MUN}

if [ ! -d $DIR ]; then
        mkdir $DIR
fi
cd $DIR
GI_createDirectories.py ../$CSV ../$CFG $LEVEL1 $LEVEL2

for d in $(ls -d */) ; do
	echo "PROCESSING " $d ...
	if [ ! -f $(pwd)/"$d/scl_data.json" ] || [ ! -f $(pwd)/"$d/scl_morph.json" ]; then
		GI_L2ASCL_AreaProcessing.sh $(pwd)/"$d" 0 
	else 
	    echo "PASSING " $d
	fi 
done

