diff --git a/scripts/build-common b/scripts/build-common index d2a85731..9dd3aa73 100644 --- a/scripts/build-common +++ b/scripts/build-common @@ -4,6 +4,15 @@ : ${BUILD:=$(pwd)/build} : ${DIST:=$(pwd)/dist} +# PREREQ: brew install coreutils +path() +{ + local UNAME=$(uname) + if [ "$UNAME" == "Darwin" ]; then greadlink -f "$1" + elif [ "$UNAME" == "Linux" ]; then readlink -f "$1"; + fi +} + write_base() { DOCKER_BASE=${DOCKER_BASE:?"DOCKER_BASE not defined"} diff --git a/scripts/run b/scripts/run index d3172745..65ffce08 100755 --- a/scripts/run +++ b/scripts/run @@ -26,7 +26,7 @@ while [ "$#" -gt 0 ]; do ;; --cloud-config) shift 1 - CLOUD_CONFIG=$(readlink -f "$1") || : + CLOUD_CONFIG=$(path "$1") || : if [ ! -f ${CLOUD_CONFIG} ]; then echo No such file: "'"${CLOUD_CONFIG}"'" 1>&2 exit 1