1: #!/usr/bin/env bash
2:
3: #
4: # $Id: fmd-docupdate,v 1.3 2025/05/05 12:38:11 snw Exp $
5: # Upload the current documentation to the FreeM website
6: #
7: #
8: # Author: Serena Willis <snw@coherent-logic.com>
9: # Copyright (C) 1998 MUG Deutschland
10: # Copyright (C) 2025 Coherent Logic Development LLC
11: #
12: #
13: # This file is part of FreeM.
14: #
15: # FreeM is free software: you can redistribute it and/or modify
16: # it under the terms of the GNU Affero Public License as published by
17: # the Free Software Foundation, either version 3 of the License, or
18: # (at your option) any later version.
19: #
20: # FreeM is distributed in the hope that it will be useful,
21: # but WITHOUT ANY WARRANTY; without even the implied warranty of
22: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23: # GNU Affero Public License for more details.
24: #
25: # You should have received a copy of the GNU Affero Public License
26: # along with FreeM. If not, see <https://www.gnu.org/licenses/>.
27: #
28: # $Log: fmd-docupdate,v $
29: # Revision 1.3 2025/05/05 12:38:11 snw
30: # Make fmd docupdate work when directory already exists
31: #
32: # Revision 1.2 2025/04/06 03:38:05 snw
33: # Prepare for adding packaging functionality to fmd
34: #
35: # Revision 1.1 2025/04/05 03:18:41 snw
36: # Add fmd docupdate command to dev scripts
37: #
38: #
39: # SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC
40: # SPDX-License-Identifier: AGPL-3.0-or-later
41: #
42:
43:
44: PGM=$(basename $0)
45:
46: function usage() {
47: echo
48: echo "Uploads current documentation to the FreeM website"
49: echo
50: echo "usage:"
51: echo
52: echo " fmd docupdate <ssh-server>"
53: echo
54: echo " The <ssh-server> argument should be in the format 'username@fqdn'."
55: echo " Do NOT specify anything else."
56: echo
57: exit 0
58: }
59:
60: if [[ $1 == "help" ]]
61: then
62: usage
63: fi
64:
65: if [[ $# == 0 ]]
66: then
67: echo "fmd-docupdate: must be run from 'fmd docupdate'"
68: exit 1
69: fi
70:
71: NEWVER=$(cat sem.ver)
72:
73: if [[ $# != 2 ]]
74: then
75: usage
76: fi
77:
78: SSHCRED=$2
79:
80: cd doc/
81: ./crdocs.sh
82:
83: DOCDIR="//var/www/freem.coherent-logic.com/docs/${NEWVER}/"
84:
85: ssh "${SSHCRED}" "mkdir -p ${DOCDIR}"
86: if [[ $? != 0 ]]
87: then
88: echo "${PGM}: error creating remote directory"
89: exit 1
90: fi
91:
92: scp freem.texi freem/*.html freem.ps freem.pdf freem.info.gz "${SSHCRED}:${DOCDIR}/"
93: if [[ $? != 0 ]]
94: then
95: echo "${PGM}: error copying docs"
96: exit 1
97: fi
98:
99: make -f Makefile.orig clean
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>