add git initialization
This commit is contained in:
@@ -128,6 +128,30 @@ async function main() {
|
||||
console.log(chalk.yellow(`\nPlease run "${packageManager} install" manually.\n`));
|
||||
}
|
||||
|
||||
// Initialize Git repository
|
||||
console.log();
|
||||
const gitSpinner = ora('Initializing Git repository...').start();
|
||||
|
||||
try {
|
||||
// Check if git is available
|
||||
execSync('git --version', { stdio: 'pipe' });
|
||||
|
||||
// Initialize git repo if not already initialized
|
||||
if (!fs.existsSync(path.join(targetDir, '.git'))) {
|
||||
execSync('git init', { cwd: targetDir, stdio: 'pipe' });
|
||||
execSync('git add .', { cwd: targetDir, stdio: 'pipe' });
|
||||
execSync('git commit -m "Initial commit from create-agentic-app"', {
|
||||
cwd: targetDir,
|
||||
stdio: 'pipe'
|
||||
});
|
||||
gitSpinner.succeed(chalk.green('Git repository initialized!'));
|
||||
} else {
|
||||
gitSpinner.info(chalk.blue('Git repository already exists'));
|
||||
}
|
||||
} catch (error) {
|
||||
gitSpinner.warn(chalk.yellow('Git not found - skipping repository initialization'));
|
||||
}
|
||||
|
||||
// Display next steps
|
||||
console.log();
|
||||
console.log(chalk.bold.green('✨ Your agentic app is ready!\n'));
|
||||
|
||||
4
create-agentic-app/package-lock.json
generated
4
create-agentic-app/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "create-agentic-app",
|
||||
"version": "1.1.4",
|
||||
"version": "1.1.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "create-agentic-app",
|
||||
"version": "1.1.4",
|
||||
"version": "1.1.5",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"chalk": "^5.3.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "create-agentic-app",
|
||||
"version": "1.1.4",
|
||||
"version": "1.1.5",
|
||||
"description": "Scaffold a new agentic AI application with Next.js, Better Auth, and AI SDK",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
||||
Reference in New Issue
Block a user