File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
packages/create-app/src/lib Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' create-rock ' : patch
3+ ---
4+
5+ feat: ask instead of bail when git has uncommited changes
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import path from 'node:path';
33import {
44 cancelPromptAndExit ,
55 isInteractive ,
6- logger ,
76 promptConfirm ,
87 resolveAbsolutePath ,
98 RockError ,
@@ -91,7 +90,7 @@ export async function run() {
9190 await validateGitStatus ( projectRoot ) ;
9291
9392 const shouldInit = await promptConfirm ( {
94- message : `Detected existing React Native project. Would you like to initialize Rock in this project ?` ,
93+ message : `Detected existing React Native project. Would you like to migrate it to Rock ?` ,
9594 confirmLabel : 'Yes' ,
9695 cancelLabel : 'No' ,
9796 } ) ;
@@ -219,10 +218,14 @@ async function validateGitStatus(dir: string) {
219218 } ) ;
220219
221220 if ( output . trim ( ) !== '' ) {
222- logger . error (
223- 'Git has uncommitted changes. Please commit or stash your changes before continuing with initializing Rock in existing project.' ,
224- ) ;
225- process . exit ( 1 ) ;
221+ const shouldContinue = await promptConfirm ( {
222+ message : `Git has uncommitted changes. Would you like to continue with initializing Rock in existing project?` ,
223+ confirmLabel : 'Yes' ,
224+ cancelLabel : 'No' ,
225+ } ) ;
226+ if ( ! shouldContinue ) {
227+ cancelPromptAndExit ( ) ;
228+ }
226229 }
227230 }
228231}
You can’t perform that action at this time.
0 commit comments