From 1812b0e56e7a4a10f6df4d3ce9f960cbd9352600 Mon Sep 17 00:00:00 2001 From: Mohamed Awnallah Date: Sat, 16 Mar 2024 04:18:07 +0200 Subject: [PATCH] scripts+dev.Dockerfile: address dockerfile build issue --- dev.Dockerfile | 1 + scripts/gen_man_pages.sh | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/dev.Dockerfile b/dev.Dockerfile index c2b203d2d2..d3ef269de4 100644 --- a/dev.Dockerfile +++ b/dev.Dockerfile @@ -14,6 +14,7 @@ ENV GODEBUG netdns=cgo # Install dependencies. RUN apk add --no-cache --update alpine-sdk \ + bash \ git \ make diff --git a/scripts/gen_man_pages.sh b/scripts/gen_man_pages.sh index f70708e074..d60e5b8aff 100755 --- a/scripts/gen_man_pages.sh +++ b/scripts/gen_man_pages.sh @@ -2,23 +2,30 @@ # Usage: ./gen_man_pages.sh DESTDIR PREFIX +# Check if lncli is installed. +function check_lncli_installed() { + if [[ ! $(command -v lncli) ]] + then + echo "lncli could not be found. Please install lncli before running this script." + exit 1 + fi +} + DESTDIR="$1" PREFIX="$2" +FULLPATH="$DESTDIR$PREFIX" -# 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 +check_lncli_installed # 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" +mkdir -p "$FULLPATH/share/man/man1" + +echo "Installing man pages to $FULLPATH/share/man/man1." +install -m 644 lnd.1 "$FULLPATH/share/man/man1/lnd.1" +install -m 644 lncli.1 "$FULLPATH/share/man/man1/lncli.1" # Remove lncli.1 and lnd.1 artifacts from the current working directory. rm -f lncli.1 lnd.1