diff --git a/hack/module.sh b/hack/module.sh index c0f34321..ebea9716 100755 --- a/hack/module.sh +++ b/hack/module.sh @@ -51,10 +51,10 @@ 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} + export MOD_DIR + echo "=> " + echo " cd ${mod_dir} && ${cmd}" + cd "${mod_dir}" && MOD_DIR="$(pwd)" && ${cmd} ) done popd