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.
This commit is contained in:
Dan Williams 2016-08-26 10:13:19 -05:00
parent 6eb279ee6e
commit e063c760c2

View File

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