feature: detect MANPATh and install there

This commit is contained in:
AJ ONeal 2021-11-20 19:57:33 -07:00 committed by Mike Farah
parent 3d620100f8
commit 2e18e2f669
1 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,14 @@
#!/bin/sh
cp yq.1 /usr/local/share/man/man1/.
my_path="$(command -v yq)"
if [ -z "$my_path" ]; then
echo 'yq' wasn't found in your PATH, so we don't know where to put the man pages.
echo Please update your PATH and try again.
exit 1
fi
# ex: ~/.local/bin/yq => ~/.local/
my_prefix="$(dirname "$(dirname "$(command -v yq)")")"
mkdir -p "$my_prefix/share/man/man1/"
cp yq.1 "$my_prefix/share/man/man1/"