From 3879c4c737b5903129b27a149ed5d7a632bbb3b0 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 11 Oct 2012 14:37:41 -0400 Subject: Run mkdir in ob-installdocs only if necessary. --- diff --git a/src/ob-installdocs.sh b/src/ob-installdocs.sh index cc3453a..f8abaa6 100644 --- a/src/ob-installdocs.sh +++ b/src/ob-installdocs.sh @@ -49,11 +49,17 @@ main() ob_info "$(ob_get_msg 'installing_docs')" "${pkg}" ob_get_doc_files | while read src dest; do if [ -f "${src}" ]; then - mkdir -p "${data_doc_dir}/${dest%/*}" || \ - ob_error "$(ob_get_msg 'cant_make_doc_dir')" + if [ "${dest%/*}" != "${dest}" ]; then + mkdir -p "${data_doc_dir}/${dest%/*}" || \ + ob_error "$(ob_get_msg 'cant_make_doc_dir')" + fi cp -R "${src}" "${data_doc_dir}/${dest}" || \ ob_error "$(ob_get_msg 'cant_cp_doc_file')" "${src}" elif [ -d "${src}" ]; then + if [ "${dest%/*}" != "${dest}" ]; then + mkdir -p "${data_doc_dir}/${dest%/*}" || \ + ob_error "$(ob_get_msg 'cant_make_doc_dir')" + fi cp -R "${src}/." "${data_doc_dir}/${dest}" || \ ob_error "$(ob_get_msg 'cant_cp_doc_file')" "${src}" fi -- cgit v0.9.1