Skip to content

Commit e3e89ed

Browse files
committed
feat: ask instead of bail when git has uncommited changes
1 parent ee4e5d9 commit e3e89ed

File tree

1 file changed

+9
-6
lines changed
  • packages/create-app/src/lib

1 file changed

+9
-6
lines changed

packages/create-app/src/lib/bin.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import path from 'node:path';
33
import {
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
}

0 commit comments

Comments
 (0)