Skip to content

Commit a8ef850

Browse files
committed
fix(migration): dynamically anchor target gitignore python virtualenv paths
1 parent b28142b commit a8ef850

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

monorepo-migration/migrate.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,25 @@ if [ -d "$SOURCE_REPO_NAME/.github/workflows" ]; then
382382
COMMIT_COUNT=$((COMMIT_COUNT + 1))
383383
fi
384384

385+
# 7.5c Anchor root .gitignore Python virtualenv paths to avoid deep package collisions
386+
if [ -f ".gitignore" ]; then
387+
echo "Anchoring Python virtual environment paths in root .gitignore to prevent nested Java package collisions..."
388+
sed -i.bak -e 's|^.env$|/.env|' \
389+
-e 's|^.venv$|/.venv|' \
390+
-e 's|^env/$|/env/|' \
391+
-e 's|^venv/$|/venv/|' \
392+
-e 's|^ENV/$|/ENV/|' \
393+
-e 's|^env.bak/$|/env.bak/|' \
394+
-e 's|^venv.bak/$|/venv.bak/|' \
395+
".gitignore"
396+
rm -f ".gitignore.bak"
397+
398+
echo "Committing root .gitignore anchors..."
399+
git add .gitignore
400+
git commit -n --no-gpg-sign -m "chore($SOURCE_REPO_NAME): anchor root .gitignore python env patterns to fix linter package collisions"
401+
COMMIT_COUNT=$((COMMIT_COUNT + 1))
402+
fi
403+
385404
# 7.6 Update generation_config.yaml
386405
echo "Updating generation_config.yaml..."
387406
SOURCE_CONFIG="$SOURCE_REPO_NAME/generation_config.yaml"

0 commit comments

Comments
 (0)