#!/usr/bin/env bash # # $Id: fmd-docupdate,v 1.3 2025/05/05 12:38:11 snw Exp $ # Upload the current documentation to the FreeM website # # # Author: Serena Willis # Copyright (C) 1998 MUG Deutschland # Copyright (C) 2025 Coherent Logic Development LLC # # # This file is part of FreeM. # # FreeM is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # FreeM is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero Public License for more details. # # You should have received a copy of the GNU Affero Public License # along with FreeM. If not, see . # # $Log: fmd-docupdate,v $ # Revision 1.3 2025/05/05 12:38:11 snw # Make fmd docupdate work when directory already exists # # Revision 1.2 2025/04/06 03:38:05 snw # Prepare for adding packaging functionality to fmd # # Revision 1.1 2025/04/05 03:18:41 snw # Add fmd docupdate command to dev scripts # # # SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC # SPDX-License-Identifier: AGPL-3.0-or-later # PGM=$(basename $0) function usage() { echo echo "Uploads current documentation to the FreeM website" echo echo "usage:" echo echo " fmd docupdate " echo echo " The argument should be in the format 'username@fqdn'." echo " Do NOT specify anything else." echo exit 0 } if [[ $1 == "help" ]] then usage fi if [[ $# == 0 ]] then echo "fmd-docupdate: must be run from 'fmd docupdate'" exit 1 fi NEWVER=$(cat sem.ver) if [[ $# != 2 ]] then usage fi SSHCRED=$2 cd doc/ ./crdocs.sh DOCDIR="//var/www/freem.coherent-logic.com/docs/${NEWVER}/" ssh "${SSHCRED}" "mkdir -p ${DOCDIR}" if [[ $? != 0 ]] then echo "${PGM}: error creating remote directory" exit 1 fi scp freem.texi freem/*.html freem.ps freem.pdf freem.info.gz "${SSHCRED}:${DOCDIR}/" if [[ $? != 0 ]] then echo "${PGM}: error copying docs" exit 1 fi make -f Makefile.orig clean