From e063c760c2bf0c8c5f2ce1928c782f359c125c42 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 26 Aug 2016 10:13:19 -0500 Subject: [PATCH] Don't error out if ${go_pkg_dir} already exists If it already exists, the world is OK and there's no need to panic. --- hack/lib/golang.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index 59ec4f85cb3..bc94e55ab63 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -267,10 +267,11 @@ kube::golang::create_gopath_tree() { local go_pkg_basedir=$(dirname "${go_pkg_dir}") mkdir -p "${go_pkg_basedir}" - rm -f "${go_pkg_dir}" # TODO: This symlink should be relative. - ln -s "${KUBE_ROOT}" "${go_pkg_dir}" + if [[ ! -e "${go_pkg_dir}" || "$(readlink ${go_pkg_dir})" != "${KUBE_ROOT}" ]]; then + ln -sTf "${KUBE_ROOT}" "${go_pkg_dir}" + fi } # Ensure the godep tool exists and is a viable version.