Skip to content

Commit f7232a8

Browse files
committed
chore: exclude common files from source root in migration script
1 parent 2bd0821 commit f7232a8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

monorepo-migration/migrate.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ git merge --allow-unrelated-histories --no-ff "$SOURCE_REPO_NAME/main" -s ours -
114114
echo "Reading tree into prefix $SOURCE_REPO_NAME/..."
115115
git read-tree --prefix="$SOURCE_REPO_NAME/" -u "$SOURCE_REPO_NAME/main"
116116

117+
# 6.5 Remove common files from the root of the migrated library
118+
echo "Removing common files from the root of $SOURCE_REPO_NAME/..."
119+
rm -f "$SOURCE_REPO_NAME/.gitignore"
120+
rm -f "$SOURCE_REPO_NAME/renovate.json"
121+
rm -f "$SOURCE_REPO_NAME/LICENSE"
122+
rm -f "$SOURCE_REPO_NAME/java.header"
123+
rm -f "$SOURCE_REPO_NAME/license-checks.xml"
124+
find "$SOURCE_REPO_NAME" -maxdepth 1 -name "*.md" ! -name "CHANGELOG.md" ! -name "README.md" -delete
125+
117126
# 7. Commit the migration
118127
echo "Committing migration..."
119128
git commit -n --no-gpg-sign -m "chore($SOURCE_REPO_NAME): migrate $SOURCE_REPO_NAME into monorepo"

0 commit comments

Comments
 (0)