ensure _man_dir/man1/ folder exists before copy
This fixes a logic error, where `$_man_dir` is checked to ensure it exists, but not the `man1` subdirectory. It feels most reasonable to ensure the selected mandir exists, but not that the file structure of the directory is user-managed.
This commit is contained in:
parent
c9a4e52623
commit
aaa1418519
|
|
@ -149,7 +149,12 @@ main() {
|
|||
|
||||
# Install manpages.
|
||||
# shellcheck disable=SC2086 # The lack of quoting is intentional.
|
||||
ensure ${_sudo} cp "man/man1/"* "${_man_dir}/man1/"
|
||||
{
|
||||
if ! [ -d "${_man_dir}/man1/" ]; then
|
||||
ensure ${_sudo} mkdir -p "${_man_dir}/man1/"
|
||||
fi
|
||||
ensure ${_sudo} cp "man/man1/"* "${_man_dir}/man1/"
|
||||
}
|
||||
log "Installed manpages to ${_man_dir}"
|
||||
|
||||
# Print success message and check $PATH.
|
||||
|
|
|
|||
Loading…
Reference in New Issue