File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -euo pipefail
33
4- MODULE_DIR =" ${1:- } "
4+ module_dir =" ${1:- } "
55
6- if [[ -z " ${MODULE_DIR } " ]]; then
6+ if [[ -z " ${module_dir } " ]]; then
77 echo " Usage: $0 <module_directory>"
88 exit 1
99fi
1010
1111# Find the repository root assuming this script is in .bazelci/
12- SCRIPT_DIR =" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
13- REPO_ROOT =" $( dirname " $SCRIPT_DIR " ) "
12+ script_dir =" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
13+ repo_root =" $( dirname " ${script_dir} " ) "
1414
15- cd " ${REPO_ROOT } "
15+ cd " ${repo_root } "
1616
17- echo " Removing files outside of ${MODULE_DIR} to simulate BCR environment..."
17+ if [[ ! -f " MODULE.bazel" ]]; then
18+ echo " Error: MODULE.bazel not found in ${repo_root} . Are you sure this is the repo root?"
19+ exit 1
20+ fi
21+
22+ if [[ ! -d " ${module_dir} " ]]; then
23+ echo " Error: Module directory '${module_dir} ' not found in ${repo_root} ."
24+ exit 1
25+ fi
26+
27+ echo " Removing files outside of ${module_dir} to simulate BCR environment..."
1828find . -maxdepth 1 -mindepth 1 \
19- ! -name " ${MODULE_DIR } " \
29+ ! -name " ${module_dir } " \
2030 ! -name " .git" \
2131 ! -name " .bazelci" \
2232 -exec rm -rf ' {}' +
You can’t perform that action at this time.
0 commit comments