create-fleetbo-project 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync } = require('child_process');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const rimraf = require('rimraf'); // Ajoutez cette ligne pour gérer la suppression du dossier .git
7
+
8
+ if (process.argv.length < 3) {
9
+ console.error('Usage: create-fleetbo-project <project-name>');
10
+ process.exit(1);
11
+ }
12
+
13
+ const projectName = process.argv[2];
14
+ const repoUrl = 'https://github.com/FleetFleetbo/dev.fleetbo.io.git'; // Remplacez par l'URL de votre modèle
15
+
16
+ try {
17
+ execSync(`git clone ${repoUrl} ${projectName}`, { stdio: 'inherit' });
18
+ process.chdir(projectName);
19
+ execSync('npm install', { stdio: 'inherit' });
20
+
21
+ // Supprimer le dossier .git
22
+ const gitDir = path.join(process.cwd(), '.git');
23
+ rimraf.sync(gitDir); // Cette ligne supprime le dossier .git
24
+
25
+ // Mettre à jour le nom dans package.json
26
+ const packageJsonPath = path.join(process.cwd(), 'package.json');
27
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
28
+ packageJson.name = projectName;
29
+ fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
30
+
31
+ console.log('Project setup complete!');
32
+ } catch (error) {
33
+ console.error('Error setting up project:', error);
34
+ }
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "create-fleetbo-project",
3
+ "version": "1.0.2",
4
+ "description": "",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1"
7
+ },
8
+ "main": "install-react-template.js",
9
+ "bin": {
10
+ "create-fleetbo-project": "install-react-template.js"
11
+ },
12
+ "dependencies": {
13
+ "rimraf": "^3.0.2"
14
+ },
15
+ "keywords": [],
16
+ "author": "",
17
+ "license": "ISC"
18
+ }