From f32a0ac33b52b0558239807db75e5971eb0f1851 Mon Sep 17 00:00:00 2001 From: Andy Neff Date: Tue, 4 Aug 2015 20:16:33 -0400 Subject: [PATCH] Made more Mac/BSD Friendly Fixes small bug involving determining relative path --- docker/docker+.bsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/docker+.bsh b/docker/docker+.bsh index 8567ff50..d9183646 100755 --- a/docker/docker+.bsh +++ b/docker/docker+.bsh @@ -8,7 +8,7 @@ else FILES=("${@}") fi -CUR_DIR=$(basename ${BASH_SOURCE[0]}) +CUR_DIR=$(dirname ${BASH_SOURCE[0]}) for FILE in "${FILES[@]}"; do if [ "${FILE}" == "-" ]; then @@ -23,9 +23,9 @@ for FILE in "${FILES[@]}"; do #My SOURCE substitution if echo $LINE | grep -q ^SOURCE; then - SOURCE=$(echo "${LINE}" | sed -r 's|^SOURCE\s+(\S*)\s*|\1|') + SOURCE=$(echo "${LINE}" | sed -E 's|^SOURCE[ ]+(.*)|\1|') if [ "${SOURCE:0:1}" != "/" ] && [ -f "${CUR_DIR}/${SOURCE}" ]; then - SOURCE="${BASH_SOURCE[0]}" "${CUR_DIR}/${SOURCE}" + SOURCE="${CUR_DIR}/${SOURCE}" fi if [ ! -f "${SOURCE}" ]; then echo "Could not find a readable ${SOURCE}" >& 2 @@ -36,4 +36,4 @@ for FILE in "${FILES[@]}"; do echo "${LINE}" fi done < ${FILE} -done \ No newline at end of file +done