Skip to content

Commit d71ceec

Browse files
Boshenclaude
andcommitted
fix: only remove legacy rolldown-vite directory with --clean flag
Move the legacy directory cleanup inside the --clean guard so a normal sync doesn't irreversibly delete the old checkout (which may contain local branches or uncommitted work). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent bfcde57 commit d71ceec

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

packages/tools/src/sync-remote-deps.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -636,13 +636,6 @@ export async function syncRemote() {
636636
// Get the root directory (assuming script is run from root)
637637
const rootDir = process.cwd();
638638

639-
// Clean up legacy 'rolldown-vite' directory (renamed to 'vite')
640-
const legacyViteDir = join(rootDir, 'rolldown-vite');
641-
if (existsSync(legacyViteDir)) {
642-
rmSync(legacyViteDir, { recursive: true, force: true });
643-
log('Removed legacy rolldown-vite directory');
644-
}
645-
646639
if (values.clean) {
647640
log('Cleaning existing repositories...');
648641
if (existsSync(join(rootDir, ROLLDOWN_DIR))) {
@@ -656,6 +649,12 @@ export async function syncRemote() {
656649
});
657650
log(`Removed ${VITE_DIR}`);
658651
}
652+
// Clean up legacy 'rolldown-vite' directory (renamed to 'vite')
653+
const legacyViteDir = join(rootDir, 'rolldown-vite');
654+
if (existsSync(legacyViteDir)) {
655+
rmSync(legacyViteDir, { recursive: true, force: true });
656+
log('Removed legacy rolldown-vite directory');
657+
}
659658
}
660659

661660
// Clone or reset repos

0 commit comments

Comments
 (0)