diff -r fd87490429aa -r 2a99fcb283ee Admin/lib/Tools/component_setup --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Admin/lib/Tools/component_setup Tue Mar 07 22:54:44 2023 +0100 @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +# +# Author: Makarius +# +# DESCRIPTION: build component for Isabelle/Java setup tool + +## usage + +PRG=$(basename "$0") + +function usage() +{ + echo + echo "Usage: isabelle $PRG COMPONENT_DIR" + echo + echo " Build component for Isabelle/Java setup tool." + echo + exit 1 +} + +function fail() +{ + echo "$1" >&2 + exit 2 +} + + +## process command line + +[ "$#" -ge 1 ] && { COMPONENT_DIR="$1"; shift; } +[ "$#" -ne 0 -o -z "$COMPONENT_DIR" ] && usage + + + +## main + +[ -d "$COMPONENT_DIR" ] && fail "Directory already exists: \"$COMPONENT_DIR\"" + + +# etc/settings + +mkdir -p "$COMPONENT_DIR/etc" +cat > "$COMPONENT_DIR/etc/settings" < "$COMPONENT_DIR/README" <