@@ -2152,90 +2152,59 @@ class Installer {
21522152 }
21532153
21542154 /**
2155- * Handle legacy BMAD v4 migration with automatic backup
2156- * @param {string } projectDir - Project directory
2157- * @param {Object } legacyV4 - Legacy V4 detection result with offenders array
2155+ * Handle legacy BMAD v4 detection with simple warning
2156+ * @param {string } _projectDir - Project directory (unused in simplified version)
2157+ * @param {Object } _legacyV4 - Legacy V4 detection result (unused in simplified version)
21582158 */
2159- async handleLegacyV4Migration ( projectDir , legacyV4 ) {
2160- console . log ( chalk . yellow . bold ( '\n⚠️ Legacy BMAD v4 detected' ) ) ;
2161- console . log ( chalk . dim ( 'The installer found legacy artefacts in your project.\n' ) ) ;
2162-
2163- // Separate _bmad* folders (auto-backup) from other offending paths (manual cleanup)
2164- const bmadFolders = legacyV4 . offenders . filter ( ( p ) => {
2165- const name = path . basename ( p ) ;
2166- return name . startsWith ( '_bmad' ) ; // Only dot-prefixed folders get auto-backed up
2167- } ) ;
2168- const otherOffenders = legacyV4 . offenders . filter ( ( p ) => {
2169- const name = path . basename ( p ) ;
2170- return ! name . startsWith ( '_bmad' ) ; // Everything else is manual cleanup
2171- } ) ;
2172-
2159+ async handleLegacyV4Migration ( _projectDir , _legacyV4 ) {
21732160 const inquirer = require ( 'inquirer' ) . default || require ( 'inquirer' ) ;
21742161
2175- // Show warning for other offending paths FIRST
2176- if ( otherOffenders . length > 0 ) {
2177- console . log ( chalk . yellow ( '⚠️ Recommended cleanup:' ) ) ;
2178- console . log ( chalk . dim ( 'It is recommended to remove the following items before proceeding:\n' ) ) ;
2179- for ( const p of otherOffenders ) console . log ( chalk . dim ( ` - ${ p } ` ) ) ;
2180-
2181- console . log ( chalk . cyan ( '\nCleanup commands you can copy/paste:' ) ) ;
2182- console . log ( chalk . dim ( 'macOS/Linux:' ) ) ;
2183- for ( const p of otherOffenders ) console . log ( chalk . dim ( ` rm -rf '${ p } '` ) ) ;
2184- console . log ( chalk . dim ( 'Windows:' ) ) ;
2185- for ( const p of otherOffenders ) console . log ( chalk . dim ( ` rmdir /S /Q "${ p } "` ) ) ;
2186-
2187- const { cleanedUp } = await inquirer . prompt ( [
2188- {
2189- type : 'confirm' ,
2190- name : 'cleanedUp' ,
2191- message : 'Have you completed the recommended cleanup? (You can proceed without it, but it is recommended)' ,
2192- default : false ,
2193- } ,
2194- ] ) ;
2195-
2196- if ( cleanedUp ) {
2197- console . log ( chalk . green ( '✓ Cleanup acknowledged\n' ) ) ;
2198- } else {
2199- console . log ( chalk . yellow ( '⚠️ Proceeding without recommended cleanup\n' ) ) ;
2200- }
2201- }
2202-
2203- // Handle _bmad* folders with automatic backup
2204- if ( bmadFolders . length > 0 ) {
2205- console . log ( chalk . cyan ( 'The following legacy folders will be moved to v4-backup:' ) ) ;
2206- for ( const p of bmadFolders ) console . log ( chalk . dim ( ` - ${ p } ` ) ) ;
2207-
2208- const { proceed } = await inquirer . prompt ( [
2209- {
2210- type : 'confirm' ,
2211- name : 'proceed' ,
2212- message : 'Proceed with backing up legacy v4 folders?' ,
2213- default : true ,
2214- } ,
2215- ] ) ;
2162+ console . log ( '' ) ;
2163+ console . log ( chalk . yellow . bold ( '⚠️ Legacy BMAD v4 detected' ) ) ;
2164+ console . log ( chalk . yellow ( '─' . repeat ( 80 ) ) ) ;
2165+ console . log ( chalk . yellow ( 'Found .bmad-method folder from BMAD v4 installation.' ) ) ;
2166+ console . log ( '' ) ;
22162167
2217- if ( proceed ) {
2218- const backupDir = path . join ( projectDir , 'v4-backup' ) ;
2219- await fs . ensureDir ( backupDir ) ;
2168+ console . log ( chalk . dim ( 'Before continuing with installation, we recommend:' ) ) ;
2169+ console . log ( chalk . dim ( ' 1. Remove the .bmad-method folder, OR' ) ) ;
2170+ console . log ( chalk . dim ( ' 2. Back it up by renaming it to another name (e.g., bmad-method-backup)' ) ) ;
2171+ console . log ( '' ) ;
22202172
2221- for ( const folder of bmadFolders ) {
2222- const folderName = path . basename ( folder ) ;
2223- const backupPath = path . join ( backupDir , folderName ) ;
2173+ console . log ( chalk . dim ( 'If your v4 installation set up rules or commands, you should remove those as well.' ) ) ;
2174+ console . log ( '' ) ;
22242175
2225- // If backup already exists, add timestamp
2226- let finalBackupPath = backupPath ;
2227- if ( await fs . pathExists ( backupPath ) ) {
2228- const timestamp = new Date ( ) . toISOString ( ) . replaceAll ( / [: .] / g, '-' ) . split ( 'T' ) [ 0 ] ;
2229- finalBackupPath = path . join ( backupDir , `${ folderName } -${ timestamp } ` ) ;
2230- }
2176+ const { proceed } = await inquirer . prompt ( [
2177+ {
2178+ type : 'list' ,
2179+ name : 'proceed' ,
2180+ message : 'What would you like to do?' ,
2181+ choices : [
2182+ {
2183+ name : 'Exit and clean up manually (recommended)' ,
2184+ value : 'exit' ,
2185+ short : 'Exit installation' ,
2186+ } ,
2187+ {
2188+ name : 'Continue with installation anyway' ,
2189+ value : 'continue' ,
2190+ short : 'Continue' ,
2191+ } ,
2192+ ] ,
2193+ default : 'exit' ,
2194+ } ,
2195+ ] ) ;
22312196
2232- await fs . move ( folder , finalBackupPath , { overwrite : false } ) ;
2233- console . log ( chalk . green ( `✓ Moved ${ folderName } to ${ path . relative ( projectDir , finalBackupPath ) } ` ) ) ;
2234- }
2235- } else {
2236- throw new Error ( 'Installation cancelled by user ') ;
2237- }
2197+ if ( proceed === 'exit' ) {
2198+ console . log ( '' ) ;
2199+ console . log ( chalk . cyan ( 'Please remove the .bmad-method folder and any v4 rules/commands,' ) ) ;
2200+ console . log ( chalk . cyan ( 'then run the installer again.' ) ) ;
2201+ console . log ( ' ') ;
2202+ process . exit ( 0 ) ;
22382203 }
2204+
2205+ console . log ( '' ) ;
2206+ console . log ( chalk . yellow ( '⚠️ Proceeding with installation despite legacy v4 folder' ) ) ;
2207+ console . log ( '' ) ;
22392208 }
22402209
22412210 /**
0 commit comments