hack/module.sh sets MOD_DIR for module tasks

This is to allow tasks which need to be executed in a module-specific
context to detect that they are being invoked appropriately.
This commit is contained in:
aram price 2020-08-14 15:06:46 -07:00
parent ccefc29eb0
commit a45748f020

View File

@ -51,6 +51,7 @@ function with_modules() {
for mod_file in $(find . -maxdepth 4 -name go.mod | sort); do
mod_dir="$(dirname "${mod_file}")"
(
export MOD_DIR="$(pwd)"
echo "=> " && \
echo " cd ${mod_dir} && ${cmd}" && \
cd "${mod_dir}" && ${cmd}