Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Manpages Script breaks Dockerfiles #8558

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ENV GODEBUG netdns=cgo

# Install dependencies.
RUN apk add --no-cache --update alpine-sdk \
bash \
git \
make

Expand Down
25 changes: 16 additions & 9 deletions scripts/gen_man_pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading