
FOLDER=giuchess-10-rc-02
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 -p 1_0_0_2/* $FOLDER

cp -p 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

echo $DEST2$ZIPNAME > file.txt
DIR=$HOME/Documents/lua/uploader
export LUA_PATH=$DIR/?.lua
lua $DIR/upload.lua 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
