--- freem/scripts/fmd-docupdate 2025/04/05 03:18:41 1.1
+++ freem/scripts/fmd-docupdate 2025/05/05 12:38:11 1.3
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#
-# $Id: fmd-docupdate,v 1.1 2025/04/05 03:18:41 snw Exp $
+# $Id: fmd-docupdate,v 1.3 2025/05/05 12:38:11 snw Exp $
# Upload the current documentation to the FreeM website
#
#
@@ -26,6 +26,12 @@
# 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
#
@@ -38,20 +44,27 @@
PGM=$(basename $0)
function usage() {
- echo "usage: fmd docupdate "
- exit 1
+ 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 [[ $# == 0 ]]
+if [[ $1 == "help" ]]
then
- echo "fmd-docupdate: must be run from 'fmd docupdate'"
- exit 1
+ usage
fi
-if [[ ! -f sem.ver ]]
+if [[ $# == 0 ]]
then
- echo "Not in the root of the FreeM repository."
+ echo "fmd-docupdate: must be run from 'fmd docupdate'"
exit 1
fi
@@ -69,7 +82,7 @@ cd doc/
DOCDIR="//var/www/freem.coherent-logic.com/docs/${NEWVER}/"
-ssh "${SSHCRED}" "mkdir ${DOCDIR}"
+ssh "${SSHCRED}" "mkdir -p ${DOCDIR}"
if [[ $? != 0 ]]
then
echo "${PGM}: error creating remote directory"