File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,14 @@ git clean -fd
7777git checkout -f main
7878git reset --hard origin/main
7979
80+ # Check if the repository is already migrated
81+ if [ -d " $SOURCE_REPO_NAME " ]; then
82+ echo " Error: Directory $SOURCE_REPO_NAME already exists in the monorepo." >&2
83+ echo " This repository seems to have already been migrated." >&2
84+ exit 1
85+ fi
86+
87+
8088# 2.5 Create a new feature branch for the migration
8189BRANCH_NAME=" migrate-$SOURCE_REPO_NAME "
8290echo " Creating feature branch: $BRANCH_NAME "
@@ -102,9 +110,6 @@ git merge --allow-unrelated-histories --no-ff "$SOURCE_REPO_NAME/main" -s ours -
102110
103111# 6. Read the tree from the source repo into the desired subdirectory
104112echo " Reading tree into prefix $SOURCE_REPO_NAME /..."
105- if [ -d " $SOURCE_REPO_NAME " ]; then
106- rm -rf " $SOURCE_REPO_NAME "
107- fi
108113git read-tree --prefix=" $SOURCE_REPO_NAME /" -u " $SOURCE_REPO_NAME /main"
109114
110115# 7. Commit the migration
You can’t perform that action at this time.
0 commit comments