refactor(monorepo): remove root cmd entrypoints
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
readonly REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||
|
||||
main() {
|
||||
local tested=0
|
||||
local package_dir
|
||||
|
||||
for package_dir in "${REPO_ROOT}"/packages/*; do
|
||||
if [[ ! -d "${package_dir}" || ! -f "${package_dir}/go.mod" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
printf 'testing %s\n' "${package_dir#${REPO_ROOT}/}"
|
||||
(
|
||||
cd "${package_dir}"
|
||||
go test ./...
|
||||
)
|
||||
tested=1
|
||||
done
|
||||
|
||||
if [[ "${tested}" -eq 0 ]]; then
|
||||
printf 'no Go runtime packages found under packages/\n' >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user