1:255.13-alt1
[systemd_ALT.git] / man / html.in
blobaaff9d138382f4c38ac1d367e3e2d892ba24aed4
1 #!/bin/sh
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3 set -e
5 if [ -z "$1" ]; then
6 echo "Use: $0 page-name (with no section suffix)"
7 exit 1
8 fi
10 # make sure the rules have been regenerated (in case update-man-rules was just run)
11 ninja -C "@BUILD_ROOT@" version.h
13 target="man/$1.html"
14 ninja -C "@BUILD_ROOT@" "$target"
16 fullname="@BUILD_ROOT@/$target"
17 if [ -f "$fullname" ]; then
18 redirect="$(readlink "$fullname" || :)"
19 else
20 redirect=""
22 if [ -n "$redirect" ]; then
23 ninja -C "@BUILD_ROOT@" "man/$redirect"
25 fullname="@BUILD_ROOT@/man/$redirect"
28 set -x
29 exec xdg-open "$fullname"