summaryrefslogtreecommitdiffstats
path: root/src/ob-installdocs.sh
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 17:41:01 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 17:41:01 (EDT)
commit24142a950a25d925e555ab31affef0b4c73f45c6 (patch)
tree527cc8b3e77f8a39ad53ee0240dcf2482790242d /src/ob-installdocs.sh
parent9d5cd1ae61eea5b4034287300c382ed591cf374a (diff)
ob-installplatconf, ob-installdocs: Replace "${dest%/*}" checks with dirname
Diffstat (limited to 'src/ob-installdocs.sh')
-rw-r--r--src/ob-installdocs.sh18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/ob-installdocs.sh b/src/ob-installdocs.sh
index cf67383..e594610 100644
--- a/src/ob-installdocs.sh
+++ b/src/ob-installdocs.sh
@@ -29,22 +29,20 @@ install_docs()
for src in ${srcs}; do
if [ -f "${src}" ]; then
- if [ x"${dest%/*}" != x"${dest}" ]; then
- if ! mkdir -p "${data_doc_dir}/${dest%/*}"; then
- ob_error "$(ob_get_msg 'cant_make_doc_dir')"
- return 1
- fi
+ if ! mkdir -p "$(dirname "${data_doc_dir}/${dest}")"
+ then
+ ob_error "$(ob_get_msg 'cant_make_doc_dir')"
+ return 1
fi
if ! cp -R "${src}" "${data_doc_dir}/${dest}"; then
ob_error "$(ob_get_msg 'cant_cp_doc_file')" "${src}"
return 1
fi
elif [ -d "${src}" ]; then
- if [ x"${dest%/*}" != x"${dest}" ]; then
- if ! mkdir -p "${data_doc_dir}/${dest%/*}"; then
- ob_error "$(ob_get_msg 'cant_make_doc_dir')"
- return 1
- fi
+ if ! mkdir -p "$(dirname "${data_doc_dir}/${dest}")"
+ then
+ ob_error "$(ob_get_msg 'cant_make_doc_dir')"
+ return 1
fi
if ! cp -R "${src}/." "${data_doc_dir}/${dest}"; then
ob_error "$(ob_get_msg 'cant_cp_doc_file')" "${src}"