From 72397ef90c043bb91514e258c0e3736bfc5d05c4 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Mon, 6 May 2019 09:40:04 +0200 Subject: [PATCH] Fix `make validate` on MacOS outside container --- script/test-integration | 4 ++-- script/update-cert.sh | 3 ++- script/update-generated-crd-code.sh | 2 +- script/validate-vendor | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/script/test-integration b/script/test-integration index 079565a86..83aec30ed 100755 --- a/script/test-integration +++ b/script/test-integration @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -e -export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPT_DIR="$( cd "$( dirname "${0}" )" && pwd -P)"; export SCRIPT_DIR export DEST=. TESTFLAGS="${TESTFLAGS} -test.timeout=20m -check.v" @@ -25,4 +25,4 @@ fi if [ -n "$TEST_HOST" ]; then echo "Testing from host…" CGO_ENABLED=0 go test -integration -host $TESTFLAGS -fi \ No newline at end of file +fi diff --git a/script/update-cert.sh b/script/update-cert.sh index 0becb1579..35c2cd825 100755 --- a/script/update-cert.sh +++ b/script/update-cert.sh @@ -5,7 +5,8 @@ set -e CERT_IMAGE="alpine:edge" # cd to the current directory so the script can be run from anywhere. -cd `dirname $0` +SCRIPT_DIR="$( cd "$( dirname "${0}" )" && pwd -P)"; export SCRIPT_DIR +cd "${SCRIPT_DIR}" # Update the cert image. docker pull $CERT_IMAGE diff --git a/script/update-generated-crd-code.sh b/script/update-generated-crd-code.sh index 7186e827c..d89eedc5e 100755 --- a/script/update-generated-crd-code.sh +++ b/script/update-generated-crd-code.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -HACK_DIR=$(dirname "${BASH_SOURCE}") +HACK_DIR="$( cd "$( dirname "${0}" )" && pwd -P)"; export HACK_DIR REPO_ROOT=${HACK_DIR}/.. ${REPO_ROOT}/vendor/k8s.io/code-generator/generate-groups.sh \ diff --git a/script/validate-vendor b/script/validate-vendor index 76099a119..580ca7253 100755 --- a/script/validate-vendor +++ b/script/validate-vendor @@ -3,14 +3,14 @@ set -o errexit set -o pipefail set -o nounset -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; export SCRIPT_DIR +SCRIPT_DIR="$( cd "$( dirname "${0}" )" && pwd -P)"; export SCRIPT_DIR vendor_dir="./vendor/" # We run dep install to and see if we have a diff afterwards echo "checking ${vendor_dir} for unintentional changes..." dep ensure -v -(${SCRIPT_DIR}/prune-dep.sh) +("${SCRIPT_DIR}"/prune-dep.sh) # Let see if the working directory is clean diffs="$(git status --porcelain -- ${vendor_dir} 2>/dev/null)"