Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wise-rats-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-rock': patch
---

feat: ask instead of bail when git has uncommited changes
15 changes: 9 additions & 6 deletions packages/create-app/src/lib/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import path from 'node:path';
import {
cancelPromptAndExit,
isInteractive,
logger,
promptConfirm,
resolveAbsolutePath,
RockError,
Expand Down Expand Up @@ -91,7 +90,7 @@ export async function run() {
await validateGitStatus(projectRoot);

const shouldInit = await promptConfirm({
message: `Detected existing React Native project. Would you like to initialize Rock in this project?`,
message: `Detected existing React Native project. Would you like to migrate it to Rock?`,
confirmLabel: 'Yes',
cancelLabel: 'No',
});
Expand Down Expand Up @@ -219,10 +218,14 @@ async function validateGitStatus(dir: string) {
});

if (output.trim() !== '') {
logger.error(
'Git has uncommitted changes. Please commit or stash your changes before continuing with initializing Rock in existing project.',
);
process.exit(1);
const shouldContinue = await promptConfirm({
message: `Git has uncommitted changes. Would you like to continue with initializing Rock in existing project?`,
confirmLabel: 'Yes',
cancelLabel: 'No',
});
if (!shouldContinue) {
cancelPromptAndExit();
}
}
}
}
Expand Down
Loading