File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77set -e
88
9- for dir in $( find . -mindepth 2 -maxdepth 2 -name owlbot.py | grep -v ' java-common-protos/' | grep -v ' java-iam/' | grep -v ' java-showcase/' | sort | xargs dirname ) ; do
9+ TARGET_MODULE=" ${1:- .} "
10+
11+ for owlbot_script in $( find " $TARGET_MODULE " -name owlbot.py | grep -v ' java-common-protos/' | grep -v ' java-iam/' | grep -v ' java-showcase/' | sort) ; do
12+ dir=$( dirname " $owlbot_script " )
1013 pushd " $dir "
1114
1215 # form a perl command to replace java.common_templates() invocation
Original file line number Diff line number Diff line change @@ -92,20 +92,13 @@ MIGRATION_HEAD_BRANCH="main"
9292echo " Basing migration branch on: ${MIGRATION_HEAD_BRANCH} "
9393
9494# 1. Clone the source repository
95- if [ ! -d " $SOURCE_DIR " ]; then
95+ if [ " ${SKIP_SOURCE_UPDATE:- false} " = " true" ] && [ -d " $SOURCE_DIR " ]; then
96+ echo " Skipping source repository update and reusing existing directory..."
97+ else
98+ echo " Ensuring clean slate for history filters by removing existing source directory..."
99+ rm -rf " $SOURCE_DIR "
96100 echo " Cloning source repo: $SOURCE_REPO_URL into $SOURCE_DIR "
97101 git clone --branch main --single-branch " $SOURCE_REPO_URL " " $SOURCE_DIR "
98- elif [ " ${SKIP_SOURCE_UPDATE:- false} " = " true" ]; then
99- echo " Skipping source repository update..."
100- else
101- echo " Source directory $SOURCE_DIR already exists. Ensuring it is clean and up-to-date..."
102- cd " $SOURCE_DIR "
103- git remote add origin " $SOURCE_REPO_URL " 2> /dev/null || git remote set-url origin " $SOURCE_REPO_URL "
104- git fetch origin main
105- git checkout -f " main"
106- git reset --hard origin/main
107- git clean -fd
108- cd - > /dev/null
109102fi
110103
111104if [ " ${SKIP_SOURCE_UPDATE:- false} " != " true" ]; then
@@ -438,7 +431,7 @@ bash generation/apply_versions.sh versions.txt current
438431
439432# 7.12c Sync all owlbot.py formatting
440433echo " Syncing all owlbot.py formatting..."
441- bash generation/update_owlbot_postprocessor_config.sh || true
434+ bash generation/update_owlbot_postprocessor_config.sh " $SOURCE_REPO_NAME " || true
442435
443436git add -u
444437git commit -n --no-gpg-sign -m " chore($SOURCE_REPO_NAME ): align versions and format owlbot configurations"
You can’t perform that action at this time.
0 commit comments