Fix update/verify-codecgen.sh for OSX.

This commit is contained in:
Eric Tune
2015-12-17 09:36:20 -08:00
parent bf67eab89f
commit 32f5f4f239
3 changed files with 15 additions and 4 deletions

View File

@@ -40,3 +40,16 @@ source "${KUBE_ROOT}/hack/lib/golang.sh"
source "${KUBE_ROOT}/hack/lib/etcd.sh"
KUBE_OUTPUT_HOSTBIN="${KUBE_OUTPUT_BINPATH}/$(kube::util::host_platform)"
# emulates "readlink -f" which is not available on BSD (OS X).
function readlinkdashf {
path=$1
# Follow links until there are no more links to follow.
while readlink "$path"; do
path="$(readlink $path)"
done
# Convert to canonical path.
path=$(cd "$(dirname "${path}")" && pwd -P)
echo "$path"
}