meso-web

Sources of the |Méso|Star> website
git clone git://git.meso-star.fr/meso-web.git
Log | Files | Refs | README | LICENSE

commit 51129302df09e9169c29f177851b82626671ef58
parent 8dfe948a8766ae9032400706ab849029e276da3b
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 23 Feb 2022 18:58:17 +0100

Add the configure.sh script

It checks that the expected commands are found on the system

Diffstat:
MMakefile | 1+
Aconfigure.sh | 43+++++++++++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile @@ -21,6 +21,7 @@ SUBDIRS=art htrdr misc schiff solstice star-engine stardis SCRIPTS=\ build_htaccess.sh\ check_html.sh\ + configure.sh\ configure_targets.sh\ convert_man.sh\ meso-menu.sh diff --git a/configure.sh b/configure.sh @@ -0,0 +1,43 @@ +#!/bin/sh -e + +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +# This script checks that the commands expected by the build process exist + +commands="\ + envsubst + gpg + man2html + rsync + shellcheck + tidy" + +printf "%s\n" "${commands}" | while read -r i; do + if ! command -v "${i}" > /dev/null; then + printf "\e[1;31mError\e[0m:%s: command not found\n" "${i}" + exit 1 + fi +done + +if ! command -v "markdown" > /dev/null \ +&& ! command -v "markdown2" > /dev/null \ +&& ! command -v "markdown_py" > /dev/null; then + printf "\e[1;31mError\e[0m: no valid 'markdown' command was found\n" + exit 1 +fi + +echo "configure done"