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 <akeesler@vmware.com>
This commit is contained in:
Andrew Keesler 2020-08-18 11:06:59 -04:00
parent c4ce97f1a5
commit e3397c1c35
No known key found for this signature in database
GPG Key ID: 27CE0444346F9413
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
# Copyright 2020 VMware, Inc. # Copyright 2020 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
set -euo pipefail set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
GOPATH="${GOPATH:-$(mktemp -d)}" GOPATH="${GOPATH:-$(mktemp -d)}"
@ -133,7 +133,7 @@ function codegen::main() {
--volume "${ROOT}:${DOCKER_ROOT_DIR}" \ --volume "${ROOT}:${DOCKER_ROOT_DIR}" \
--workdir "${DOCKER_MOD_DIR}" \ --workdir "${DOCKER_MOD_DIR}" \
"${CODEGEN_IMAGE}" \ "${CODEGEN_IMAGE}" \
"${DOCKER_ROOT_DIR}/hack/$(basename "${BASH_SOURCE[0]}")" \ "${DOCKER_ROOT_DIR}/hack/lib/$(basename "${BASH_SOURCE[0]}")" \
"${codegen_command}" "${codegen_command}"
fi fi
} }

View File

@ -34,11 +34,11 @@ function unittest_cmd() {
} }
function codegen_cmd() { function codegen_cmd() {
echo "${ROOT}/hack/codegen.sh codegen::generate" echo "${ROOT}/hack/lib/codegen.sh codegen::generate"
} }
function codegen_verify_cmd() { 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 # The race detector is slow, so sometimes you don't want to use it