create-fleetbo-project 1.0.22 → 1.0.23
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.
- package/install-react-template.js +6 -10
- package/package.json +1 -1
|
@@ -7,11 +7,11 @@ const https = require('https');
|
|
|
7
7
|
const unzipper = require('unzipper');
|
|
8
8
|
|
|
9
9
|
// --- Configuration ---
|
|
10
|
-
// !!! VÉRIFIEZ ET CORRIGEZ CES DEUX LIGNES !!!
|
|
11
10
|
const repoOwner = 'FleetFleetbo'; // Assurez-vous que c'est le bon nom d'utilisateur GitHub
|
|
12
11
|
const repoName = 'dev.fleetbo.io'; // Assurez-vous que c'est le bon nom de dépôt
|
|
12
|
+
const branchName = 'master'; // Le nom de la branche est maintenant configurable
|
|
13
13
|
|
|
14
|
-
const repoUrl = `https://github.com/${repoOwner}/${repoName}/archive/refs/heads
|
|
14
|
+
const repoUrl = `https://github.com/${repoOwner}/${repoName}/archive/refs/heads/${branchName}.zip`;
|
|
15
15
|
|
|
16
16
|
// URL de votre Cloud Function.
|
|
17
17
|
const bootstrapUrl = 'https://us-central1-myapp-259bf.cloudfunctions.net/bootstrapProject';
|
|
@@ -97,16 +97,11 @@ async function setupProject() {
|
|
|
97
97
|
|
|
98
98
|
}).on('error', (err) => reject(new Error(`Erreur réseau lors du téléchargement: ${err.message}`)));
|
|
99
99
|
});
|
|
100
|
-
|
|
101
|
-
// La suite du script a été omise pour la brièveté mais reste identique...
|
|
102
|
-
// ...
|
|
103
|
-
// Le renommage et le reste de la logique doit être ici
|
|
104
|
-
// ...
|
|
105
100
|
|
|
106
101
|
console.log(' [2/5] ✅ Template téléchargé et décompressé.');
|
|
107
102
|
|
|
108
|
-
// Le dossier décompressé aura un nom comme "repoName-
|
|
109
|
-
fs.renameSync(`${repoName}
|
|
103
|
+
// Le dossier décompressé aura un nom comme "repoName-master", on le renomme
|
|
104
|
+
fs.renameSync(`${repoName}-${branchName}`, projectName);
|
|
110
105
|
|
|
111
106
|
process.chdir(projectName);
|
|
112
107
|
console.log(' [3/5] 🔑 Récupération des clés de projet...');
|
|
@@ -139,7 +134,7 @@ async function setupProject() {
|
|
|
139
134
|
console.log(' Nettoyage du répertoire du projet...');
|
|
140
135
|
fs.rmSync(dirToDelete, { recursive: true, force: true });
|
|
141
136
|
}
|
|
142
|
-
const extractedDir = path.join(process.cwd(), `${repoName}
|
|
137
|
+
const extractedDir = path.join(process.cwd(), `${repoName}-${branchName}`);
|
|
143
138
|
if (fs.existsSync(extractedDir)) {
|
|
144
139
|
console.log(' Nettoyage du répertoire temporaire...');
|
|
145
140
|
fs.rmSync(extractedDir, { recursive: true, force: true });
|
|
@@ -149,3 +144,4 @@ async function setupProject() {
|
|
|
149
144
|
}
|
|
150
145
|
|
|
151
146
|
setupProject();
|
|
147
|
+
|