1
0
mirror of https://github.com/rancher/os.git synced 2025-09-13 13:39:53 +00:00

./scripts/run: support OS X

This commit is contained in:
Ivan Mikushin
2015-07-21 15:55:58 +05:00
parent b7b52c65a1
commit 229e4e0fbd
2 changed files with 10 additions and 1 deletions

View File

@@ -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"}

View File

@@ -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