summaryrefslogtreecommitdiffstats
path: root/src/ob-installplatconf.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-installplatconf.sh
parent9d5cd1ae61eea5b4034287300c382ed591cf374a (diff)
ob-installplatconf, ob-installdocs: Replace "${dest%/*}" checks with dirname
Diffstat (limited to 'src/ob-installplatconf.sh')
-rw-r--r--src/ob-installplatconf.sh13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/ob-installplatconf.sh b/src/ob-installplatconf.sh
index c4a4765..d980ff8 100644
--- a/src/ob-installplatconf.sh
+++ b/src/ob-installplatconf.sh
@@ -28,6 +28,7 @@ copy_config()
{
list="${1}"
dest_base="${2}"
+ dir=
while read -r src dest; do
if [ -z "${src}" ] || [ -z "${dest}" ]; then
@@ -36,13 +37,11 @@ copy_config()
fi
# Make sure the destination directory exists.
- if [ "x${dest%/*}" != "x${dest}" ]; then
- if ! mkdir -p "${dest_base}/${dest%/*}"; then
- ob_error "$(ob_get_msg \
- 'cant_make_config_dest_dir')" \
- "${dest%/*}"
- return 1
- fi
+ dir="(dirname "${dest_base}/${dest}")"
+ if ! mkdir -p "${dir}"; then
+ ob_error "$(ob_get_msg 'cant_make_config_dest_dir')" \
+ "${dir}"
+ return 1
fi
# Find the config package files.