echo "Cleaning $DEST_DIR"
rm -rd $DEST_DIR/*
echo "Copying files"
cp -r * $DEST_DIR
echo "Deleting residual emacs files"
for FILE in `find $DEST_DIR -type f -name '*~'`
do
rm $FILE
done
echo "Changing to host"
for FILE in `find $DEST_DIR -type f -iname 'index.gph'`
do
sed -i "s/|localhost|/|$HOST|/g" $FILE
sed -i "s+|/+|$DEST_PATH+g" $FILE
done
echo "Compilation complete"
cd $DEST_DIR
tar -czf $DEST_FILE *
echo "Upload file ready at $DEST_FILE"