#! /bin/bash
#
#	Verificar versao do projeto

#	Checar usuario
USER=$(whoami)
if [ $USER = "root" ] ;then
    [ "$#" = 0 ] && echo -e "Especifique um usuario." && exit 1
    [ "$1" ] && _USER="$1"
else
    _USER="$USER"
    :
fi

#	Definir variaveis globais
_HOME="/home/$_USER"
_PATH_EDIR="/home/$_USER/edirectory"
KERNEL_V="$_PATH_EDIR/src/ArcaSolutions/CoreBundle/Kernel/Kernel.php"
EDIR_VERSION="$(grep "const VERSION = " $KERNEL_V | awk -F\' '{print $2}')"

#	Mostrar resultado
echo -e "$EDIR_VERSION"
