From 13d4a38eca1f749a521a6a57734b729590bb0657 Mon Sep 17 00:00:00 2001 From: Aram Price Date: Tue, 11 Aug 2020 14:41:04 -0400 Subject: [PATCH] hack/update-codegen.sh: fix symlink paths Wow fun times with symlinks. We *think* this script should work in CI now...but we'll see. Previously we were seeing a false positive where even though the generated code was out of date, the CI step did not report failure. Signed-off-by: Andrew Keesler --- hack/update-codegen.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 2b2c1672f..e8f6afe0a 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -14,9 +14,10 @@ function codegen() { if [[ ${IN_DOCKER:-0} -eq 1 ]]; then # Already in a container ($CODEGEN_IMAGE). mkdir -p "$(dirname /go/src/$BASE_PKG/$PKG)" - ln -sf "$ROOT" "/go/src/$BASE_PKG/$PKG" + test -e "/go/src/$BASE_PKG/$PKG" || ln -s "$ROOT" "/go/src/$BASE_PKG/$PKG" cd "/go/src/$BASE_PKG/$PKG" - /codegen/entrypoint.sh "$@" 2>&1 | sed "s|^|$1 ($PKG) > |" + /codegen/entrypoint.sh "$@" 2>&1 \ + | sed "s|^|$1 ($PKG) > |" else # Local workstation. docker run \