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 <akeesler@vmware.com>
This commit is contained in:
Aram Price 2020-08-11 14:41:04 -04:00 committed by Andrew Keesler
parent 28a500fce9
commit 13d4a38eca
No known key found for this signature in database
GPG Key ID: 27CE0444346F9413

View File

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