Skip to content

Commit

Permalink
check prefix for permission, create man-page subdir
Browse files Browse the repository at this point in the history
This will hopefully then allow users to install even if the man page sub-directories do not already exist in the install prefix location.
  • Loading branch information
tomeichlersmith authored Sep 5, 2023
1 parent f754454 commit 65c5594
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ if [ -z "${prefix}" ]; then
prefix="${HOME}/.local"
fi
fi

if [ ! -w "${prefix}" ]; then
_denv_error "Cannot write into ${prefix}, permission denied"
exit 1
fi

completion_dest_path="${prefix}/share/bash-completion/completions/"
dest_path="${prefix}/bin"
man_dest_path="${prefix}/share/man/man1"
Expand All @@ -130,9 +136,8 @@ cd "${curr_dir}" || exit 1
if [ ! -d "${dest_path}" ]; then
mkdir -p "${dest_path}"
fi
if [ ! -w "${man_dest_path}" ]; then
_denv_error "Cannot write into ${man_dest_path}, permission denied"
exit 1
if [ ! -d "${man_dest_path}" ]; then
mkdir -p "${man_dest_path}"
fi
if [ ! -d "${completion_dest_path}" ]; then
mkdir -p "${completion_dest_path}"
Expand Down

0 comments on commit 65c5594

Please sign in to comment.