Skip to content

Commit 8c11201

Browse files
committed
feat(cli): add initial commit after git init
1 parent 0255673 commit 8c11201

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

apps/cli/src/commands/init.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const init = new Command()
4343
type: 'text',
4444
name: 'projectPath',
4545
message: `Enter the project name or relative path (e.g., 'my-app' or './apps/my-app'):`,
46-
initial: './starter-base',
46+
initial: './my-app',
4747
});
4848

4949
const { packageManager } = await prompts({
@@ -89,11 +89,13 @@ export const init = new Command()
8989
]);
9090

9191
if (packageManager !== 'none') {
92-
spinner.start(`Installing dependencies using ${packageManager}...`);
92+
spinner.start(
93+
`Installing dependencies using ${packageManager} (this may take a few minutes)...`
94+
);
9395
await execa(packageManager, ['install'], {
9496
cwd: fullProjectPath,
9597
});
96-
spinner.text = 'Running expo doctor to fix package version conflicts...';
98+
spinner.text = 'Running expo doctor to ensure package compatibility...';
9799
await execa('npx', ['expo', 'install', '--fix'], {
98100
cwd: fullProjectPath,
99101
});
@@ -110,6 +112,13 @@ export const init = new Command()
110112
spinner.start('Initializing Git repository...');
111113
try {
112114
execSync('git init', { stdio: 'inherit', cwd: fullProjectPath });
115+
116+
execSync('git add -A', { stdio: 'inherit', cwd: fullProjectPath });
117+
execSync('git commit -m "initialize project with @react-native-reusables/cli"', {
118+
stdio: 'inherit',
119+
cwd: fullProjectPath,
120+
});
121+
113122
spinner.succeed('Git repository initialized successfully.');
114123
} catch (error) {
115124
logger.error('Failed to initialize Git repository:', error);

0 commit comments

Comments
 (0)