File:  [Coherent Logic Development] / freem / scripts / fmd-log
Revision 1.2: download - view: text, annotated - select for diffs
Sun Apr 6 03:38:05 2025 UTC (5 days ago) by snw
Branches: MAIN
CVS tags: HEAD
Prepare for adding packaging functionality to fmd

#!/usr/bin/env bash

#
#   $Id: fmd-log,v 1.2 2025/04/06 03:38:05 snw Exp $
#    Log work in FreeM repository
#
#  
#   Author: Serena Willis <snw@coherent-logic.com>
#    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 <https://www.gnu.org/licenses/>.
#
#   $Log: fmd-log,v $
#   Revision 1.2  2025/04/06 03:38:05  snw
#   Prepare for adding packaging functionality to fmd
#
#   Revision 1.1  2025/04/04 18:00:01  snw
#   *** empty log message ***
#
#
# SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
# SPDX-License-Identifier: AGPL-3.0-or-later
#

function usage() {
    echo
    echo "Adds an entry to the FreeM ChangeLog"
    echo
    echo "usage:"
    echo
    echo "  fmd log \"<log-message>\""
    echo
    echo " <log-message> should contain the entry you want."
    echo
    exit 0
}

if [[ $1 == "help" ]]
then
    usage
fi

if [[ $# == 0 ]]
then
    echo "log:  must be run from 'fmd log'"
    exit 1
fi

if [[ ! -f sem.ver ]]
then
    echo "Not in the root of the FreeM repository."
    exit 1
fi

if [[ $# != 2 ]]
then
    usage
fi

FMD="$1"
MSG="$2"
LOGDATE="$(date +"%D %T")"
LOGMSG="${MSG} [$(whoami)@$(hostname) ${LOGDATE}]"

echo "  * ${LOGMSG}" >> ChangeLog


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>