Skip to content
Snippets Groups Projects
download.sh 1.25 KiB
Newer Older
####################################
# CLONE THE YALES2BIO REPO
####################################
midou's avatar
midou committed
git clone git@gitlab.coria-cfd.fr:yales2bio-devel/yales2bio-devel.git 1>/dev/null 2>/dev/null

####################################
# TEST THE DOWNLOAD
####################################
echo "##########################"
echo "CHECKING THE DOWNLOAD (Y2B):"
if [ "$(ls -A ./yales2bio-devel/src/main 2>/dev/null)" ]; then
     echo ">> main directory is not empty - DOWNLOAD SUCCESSFUL"
     download=1
else
     echo ">> main directory is empty - DONWLOAD FAILED"
     download=0
fi 

####################################
# GO TO THE RIGHT COMMIT
####################################
if [ $download = 1 ]; then
   cd ./yales2bio-devel/
   git checkout 8de0e3c11c0d701d93bdaa2e034cd496e0ed60b2 2>/dev/null
   cd ../
fi

####################################
# CHECK THE COMMIT
####################################
echo "CHECKING THE COMMIT (Y2B):"
cd ./yales2bio-devel/
git log >test.txt
var=`head -n 1 test.txt | awk -F " " '{print $2}'`
rm -rf test.txt
if [ $var = "8de0e3c11c0d701d93bdaa2e034cd496e0ed60b2" ]; then
     echo ">> checkout to the right commit: SUCCESSFUL"
else
     echo ">> checkout to the right commit: FAILED"
fi
cd ../
echo "##########################"