@celo/celo-composer
Advanced tools
Comparing version
@@ -120,3 +120,4 @@ "use strict"; | ||
console.log(chalk_1.default.white(" pnpm dev")); | ||
console.log(chalk_1.default.gray("\nHappy coding! š\n")); | ||
console.log(chalk_1.default.gray("\nYour project has been initialized with Git and an initial commit has been created.")); | ||
console.log(chalk_1.default.gray("Happy coding! š\n")); | ||
} | ||
@@ -123,0 +124,0 @@ catch (error) { |
@@ -9,3 +9,5 @@ "use strict"; | ||
const child_process_1 = require("child_process"); | ||
const fs_extra_1 = __importDefault(require("fs-extra")); | ||
const ora_1 = __importDefault(require("ora")); | ||
const path_1 = __importDefault(require("path")); | ||
const util_1 = require("util"); | ||
@@ -40,3 +42,60 @@ const plop_generator_1 = require("./plop-generator"); | ||
} | ||
// Initialize Git repository and create initial commit | ||
const gitSpinner = (0, ora_1.default)("Initializing Git repository...").start(); | ||
try { | ||
// Check if Git is installed | ||
try { | ||
await execAsync("git --version"); | ||
} | ||
catch (error) { | ||
gitSpinner.warn("Git is not installed. Skipping Git initialization."); | ||
return; | ||
} | ||
// Initialize Git repository | ||
await execAsync("git init", { cwd: projectPath }); | ||
// Create .gitignore if it doesn't exist | ||
const gitignorePath = path_1.default.join(projectPath, ".gitignore"); | ||
if (!fs_extra_1.default.existsSync(gitignorePath)) { | ||
const defaultGitignore = `# Dependencies | ||
node_modules | ||
.pnpm-store | ||
# Build outputs | ||
.next | ||
dist | ||
out | ||
# Environment variables | ||
.env*.local | ||
# Debug logs | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
# Local development | ||
.DS_Store | ||
*.pem | ||
# IDE | ||
.idea | ||
.vscode | ||
*.swp | ||
*.swo | ||
`; | ||
await fs_extra_1.default.writeFile(gitignorePath, defaultGitignore); | ||
} | ||
// Add all files and create initial commit | ||
await execAsync("git add .", { cwd: projectPath }); | ||
await execAsync('git commit -m "Initial commit"', { | ||
cwd: projectPath, | ||
env: { ...process.env, GIT_AUTHOR_NAME: "Celo Composer", GIT_AUTHOR_EMAIL: "composer@celo.org" } | ||
}); | ||
gitSpinner.succeed("Git repository initialized with initial commit"); | ||
} | ||
catch (error) { | ||
gitSpinner.fail("Failed to initialize Git repository"); | ||
console.log(chalk_1.default.yellow("You can initialize Git manually later with: git init && git add . && git commit -m 'Initial commit'")); | ||
} | ||
} | ||
//# sourceMappingURL=project-generator.js.map |
{ | ||
"name": "@celo/celo-composer", | ||
"version": "2.2.5", | ||
"version": "2.2.6", | ||
"description": "CLI tool for generating customizable Celo blockchain starter kits", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
110882
2.85%562
10.85%5
150%