@cerema/cadriciel 1.3.91 → 1.4.0-a
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/cli/global/init.js +78 -22
- package/lib/cadriciel.js +1 -1
- package/package.json +1 -1
package/cli/global/init.js
CHANGED
|
@@ -110,16 +110,66 @@ module.exports = (args) => {
|
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
exec('
|
|
114
|
-
if (errorPnpm)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
113
|
+
exec('bun -v', (errorPnpm) => {
|
|
114
|
+
if (errorPnpm)
|
|
115
|
+
return exec('pnpm -v', (errorPnpm) => {
|
|
116
|
+
if (errorPnpm) {
|
|
117
|
+
spinner.fail(
|
|
118
|
+
`pnpm n'est pas installé sur votre système ! (https://pnpm.js.org/installation)`
|
|
119
|
+
);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
120
122
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
// If git and pnpm are installed, proceed with the operations
|
|
124
|
+
exec('pnpm i', (errorInstall) => {
|
|
125
|
+
if (errorInstall) {
|
|
126
|
+
spinner.fail(
|
|
127
|
+
`Problème pendant l'installation des dépendances :\n`,
|
|
128
|
+
errorInstall
|
|
129
|
+
);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
exec(
|
|
134
|
+
'git init && git add --all && git commit -m "first commit" && git checkout -b dev',
|
|
135
|
+
(errorGit) => {
|
|
136
|
+
if (errorGit) {
|
|
137
|
+
spinner.fail(
|
|
138
|
+
'Error occurred during git operations:',
|
|
139
|
+
errorGit
|
|
140
|
+
);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
spinner.succeed(
|
|
145
|
+
'🚀 Votre projet a été correctement installé.\n'
|
|
146
|
+
);
|
|
147
|
+
console.log(
|
|
148
|
+
`\n──────────────────────────────────────────────────────────────
|
|
149
|
+
|
|
150
|
+
Pour lancer l'environnement local de développement :
|
|
151
|
+
|
|
152
|
+
${chalk.magenta(' 📦 nécessite docker et docker-compose\n')}
|
|
153
|
+
|
|
154
|
+
cd ${chalk.green(name)}
|
|
155
|
+
${chalk.cyan('cad start')} .............. 🚀 ${chalk.bold(
|
|
156
|
+
"démarre l'environnement local de développement"
|
|
157
|
+
)}
|
|
158
|
+
|
|
159
|
+
${chalk.cyan('cad stop')} ............... 🚦 ${chalk.bold(
|
|
160
|
+
"arrête l'environnement."
|
|
161
|
+
)}
|
|
162
|
+
|
|
163
|
+
👉 https://cadriciel.k8-dev.cerema.fr/api 👈
|
|
164
|
+
|
|
165
|
+
──────────────────────────────────────────────────────────────\n`
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
// If bun is installed, proceed with the operations
|
|
172
|
+
exec('bun i', (errorInstall) => {
|
|
123
173
|
if (errorInstall) {
|
|
124
174
|
spinner.fail(
|
|
125
175
|
`Problème pendant l'installation des dépendances :\n`,
|
|
@@ -139,23 +189,29 @@ module.exports = (args) => {
|
|
|
139
189
|
spinner.succeed('🚀 Votre projet a été correctement installé.\n');
|
|
140
190
|
console.log(
|
|
141
191
|
`\n──────────────────────────────────────────────────────────────
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
192
|
+
|
|
193
|
+
Pour lancer l'environnement local de développement :
|
|
194
|
+
|
|
195
|
+
${chalk.magenta(
|
|
196
|
+
' 📦 nécessite docker et docker-compose\n'
|
|
197
|
+
)}
|
|
198
|
+
|
|
199
|
+
cd ${chalk.green(name)}
|
|
200
|
+
${chalk.cyan(
|
|
201
|
+
'cad start'
|
|
202
|
+
)} .............. 🚀 ${chalk.bold(
|
|
149
203
|
"démarre l'environnement local de développement"
|
|
150
204
|
)}
|
|
151
|
-
|
|
152
|
-
|
|
205
|
+
|
|
206
|
+
${chalk.cyan(
|
|
207
|
+
'cad stop'
|
|
208
|
+
)} ............... 🚦 ${chalk.bold(
|
|
153
209
|
"arrête l'environnement."
|
|
154
210
|
)}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
──────────────────────────────────────────────────────────────\n`
|
|
211
|
+
|
|
212
|
+
👉 https://cadriciel.k8-dev.cerema.fr/api 👈
|
|
213
|
+
|
|
214
|
+
──────────────────────────────────────────────────────────────\n`
|
|
159
215
|
);
|
|
160
216
|
}
|
|
161
217
|
);
|
package/lib/cadriciel.js
CHANGED
|
@@ -3,7 +3,7 @@ const chalk = require('chalk-v2');
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const os = require('os');
|
|
5
5
|
const HomeDir = os.homedir() + '/.cadriciel';
|
|
6
|
-
const baseURL = 'https://
|
|
6
|
+
const baseURL = 'https://cadriciel.k8-dev.cerema.fr/api';
|
|
7
7
|
//const baseURL = 'http://127.0.0.1:3000/api';
|
|
8
8
|
|
|
9
9
|
class CadricielAPI {
|