
FOLDER=gumble-rc-240529
ZIPNAME=$FOLDER.zip

DEST1=/run/media/roland/CHASTAIN-1/sauvegardes/
#DEST2=$HOME/Documents/site/public_html/roland/sauvegardes/
DEST2=$HOME/Documents/site/public_html/downloads/chess/

mkdir $FOLDER

rsync -av --exclude='git/.git' --exclude='git/build' --exclude='git/.gitignore' git $FOLDER

cp git/build/src/gumble $FOLDER

cp readme.txt $FOLDER

zip -r $ZIPNAME $FOLDER

if [ -d $DEST1 ]; then
  cp -fv $ZIPNAME $DEST1
else
  echo "[WARNING] Cannot find directory $DEST1"
fi

mv -fv $ZIPNAME $DEST2
echo $DEST2$ZIPNAME > file.txt && uploader file.txt

exit 0

pushd ..
zip -r $FOLDERNAME-$DATETIMESTAMP.zip $FOLDERNAME -x $FOLDERNAME/\.git/\* -x $FOLDERNAME/\*\.sh
cp -fv $FOLDERNAME-$DATETIMESTAMP.zip /run/media/roland/CHASTAIN-1/sauvegardes/
mv -fv $FOLDERNAME-$DATETIMESTAMP.zip $HOME/Documents/site/public_html/roland/echecs-aleatoires-fischer/sources.zip
popd
