2016-06-02 19:33:28 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
|
|
|
|
|
|
|
|
if [ ! -f zerotier-cli.1.md ]; then
|
|
|
|
echo 'This script must be run from the doc/ subfolder of the ZeroTier tree.'
|
|
|
|
fi
|
|
|
|
|
2016-06-08 21:06:19 +00:00
|
|
|
rm -f *.1 *.2 *.8
|
2016-06-02 19:33:28 +00:00
|
|
|
|
2016-06-27 22:21:24 +00:00
|
|
|
if [ -e /usr/bin/ronn -o -e /usr/local/bin/ronn ]; then
|
2016-06-29 16:45:02 +00:00
|
|
|
# Use 'ronn' which is available as a package on many distros including Debian
|
2016-06-27 22:21:24 +00:00
|
|
|
ronn -r zerotier-cli.1.md
|
|
|
|
ronn -r zerotier-idtool.1.md
|
|
|
|
ronn -r zerotier-one.8.md
|
2016-06-08 21:06:19 +00:00
|
|
|
else
|
2016-06-29 16:45:02 +00:00
|
|
|
# Use 'marked-man' from npm
|
|
|
|
NODE=/usr/bin/node
|
|
|
|
if [ ! -e $NODE ]; then
|
|
|
|
if [ -e /usr/bin/nodejs ]; then
|
|
|
|
NODE=/usr/bin/nodejs
|
|
|
|
elif [ -e /usr/local/bin/node ]; then
|
|
|
|
NODE=/usr/local/bin/node
|
|
|
|
elif [ -e /usr/local/bin/nodejs ]; then
|
|
|
|
NODE=/usr/local/bin/nodejs
|
|
|
|
else
|
|
|
|
echo 'Unable to find ronn or node/npm -- cannot build man pages!'
|
|
|
|
exit 1
|
|
|
|
fi
|
2016-06-16 00:11:46 +00:00
|
|
|
fi
|
|
|
|
|
2016-06-08 21:06:19 +00:00
|
|
|
if [ ! -f node_modules/marked-man/bin/marked-man ]; then
|
2016-06-29 16:45:02 +00:00
|
|
|
echo 'Installing npm package "marked-man" -- MarkDown to ROFF converter...'
|
2016-06-08 21:06:19 +00:00
|
|
|
npm install marked-man
|
|
|
|
fi
|
2016-06-08 17:13:31 +00:00
|
|
|
|
2016-06-08 21:06:19 +00:00
|
|
|
$NODE node_modules/marked-man/bin/marked-man zerotier-cli.1.md >zerotier-cli.1
|
|
|
|
$NODE node_modules/marked-man/bin/marked-man zerotier-idtool.1.md >zerotier-idtool.1
|
|
|
|
$NODE node_modules/marked-man/bin/marked-man zerotier-one.8.md >zerotier-one.8
|
|
|
|
fi
|
2016-06-02 19:33:28 +00:00
|
|
|
|
|
|
|
exit 0
|