From dfd1636f18bf7c893a66fc102deda319feb1f6b5 Mon Sep 17 00:00:00 2001 From: Mohamed Awnallah Date: Mon, 11 Mar 2024 14:16:05 +0200 Subject: [PATCH] scripts: add `gen_man_pages.sh` script --- scripts/gen_man_pages.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 scripts/gen_man_pages.sh diff --git a/scripts/gen_man_pages.sh b/scripts/gen_man_pages.sh new file mode 100755 index 000000000..f70708e07 --- /dev/null +++ b/scripts/gen_man_pages.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Usage: ./gen_man_pages.sh DESTDIR PREFIX + +DESTDIR="$1" +PREFIX="$2" + +# Check if lncli is installed. +if ! command -v lncli &> /dev/null +then + echo "lncli could not be found. Please install lncli before running this script." + exit 1 +fi + +# Ignore warnings regarding HTMLBlock detection in go-md2man package +# since using "<...>" is part of our docs. +lncli generatemanpage 2>&1 | grep -v "go-md2man does not handle node type HTMLSpan" || true + +echo "Installing man pages to $DESTDIR$PREFIX/share/man/man1." +install -m 644 lnd.1 "$DESTDIR$PREFIX/share/man/man1/lnd.1" +install -m 644 lncli.1 "$DESTDIR$PREFIX/share/man/man1/lncli.1" + +# Remove lncli.1 and lnd.1 artifacts from the current working directory. +rm -f lncli.1 lnd.1