#!/bin/bash



usage() {

	echo "No cible is present in /data/"
	exit

}


RmEnv() {
	rm -Rf ${Wai}/ESL/.Prefetch/
	rm -Rf ${Wai}/Workspace/*
}

Wai=/data/cible

[[ ! -d $Wai ]] && usage 


cd ${Wai}/ESL/GenELMU/
source ${Wai}/ESL/setenv.sh

[[ $1 == "del" ]] && RmEnv
	
[[ "$ESL_PROJECT" != "ESL" ]] && ProductElemu="i"

yes | ./ESL_Gen_ELMUs.sh -p${ProductElemu}

cd ${Wai}/ESL/GenOS/
./ESL_Generate.sh
