From e3397c1c35438869147c5742734133897993c970 Mon Sep 17 00:00:00 2001 From: Andrew Keesler Date: Tue, 18 Aug 2020 11:06:59 -0400 Subject: [PATCH] Hide codegen.sh in hack/lib We don't want people to run codegen.sh directly, because it is meant to be driven by hack/module.sh. To discourage this behavior, we will hide codegen.sh away in hack/lib. I don't think this is actually what the hack/lib directory is for, though...meh. Signed-off-by: Andrew Keesler --- hack/{ => lib}/codegen.sh | 4 ++-- hack/module.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename hack/{ => lib}/codegen.sh (97%) diff --git a/hack/codegen.sh b/hack/lib/codegen.sh similarity index 97% rename from hack/codegen.sh rename to hack/lib/codegen.sh index 2981b97e..bb0a1ac6 100755 --- a/hack/codegen.sh +++ b/hack/lib/codegen.sh @@ -3,7 +3,7 @@ # Copyright 2020 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail -ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" GOPATH="${GOPATH:-$(mktemp -d)}" @@ -133,7 +133,7 @@ function codegen::main() { --volume "${ROOT}:${DOCKER_ROOT_DIR}" \ --workdir "${DOCKER_MOD_DIR}" \ "${CODEGEN_IMAGE}" \ - "${DOCKER_ROOT_DIR}/hack/$(basename "${BASH_SOURCE[0]}")" \ + "${DOCKER_ROOT_DIR}/hack/lib/$(basename "${BASH_SOURCE[0]}")" \ "${codegen_command}" fi } diff --git a/hack/module.sh b/hack/module.sh index f5c94834..be1e7e12 100755 --- a/hack/module.sh +++ b/hack/module.sh @@ -34,11 +34,11 @@ function unittest_cmd() { } function codegen_cmd() { - echo "${ROOT}/hack/codegen.sh codegen::generate" + echo "${ROOT}/hack/lib/codegen.sh codegen::generate" } function codegen_verify_cmd() { - echo "${ROOT}/hack/codegen.sh codegen::verify" + echo "${ROOT}/hack/lib/codegen.sh codegen::verify" } # The race detector is slow, so sometimes you don't want to use it