@cerema/cadriciel 1.4.38 β 1.5.0
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/doc.js +1 -1
- package/cli/global/doctor.js +21 -15
- package/cli/global/init.js +6 -2
- package/cli/global/load.js +11 -5
- package/cli/global/upgrade.js +9 -2
- package/cli.js +1 -1
- package/package.json +1 -1
package/cli/global/doc.js
CHANGED
package/cli/global/doctor.js
CHANGED
|
@@ -15,13 +15,6 @@ module.exports = (args) => {
|
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
const extractLiquibaseVersion = (output) => {
|
|
20
|
-
const versionLine = output
|
|
21
|
-
.split('\n')
|
|
22
|
-
.find((line) => line.startsWith('Liquibase Version:'));
|
|
23
|
-
return versionLine ? versionLine.trim() : 'Version not found';
|
|
24
|
-
};
|
|
25
18
|
return {
|
|
26
19
|
info: {
|
|
27
20
|
title: 'doctor',
|
|
@@ -29,27 +22,29 @@ module.exports = (args) => {
|
|
|
29
22
|
},
|
|
30
23
|
start: () => {
|
|
31
24
|
console.log(' ');
|
|
25
|
+
|
|
32
26
|
console.log(' π₯ ' + chalk.bold('PrΓ©-requis globaux'));
|
|
33
27
|
console.log(' ');
|
|
34
28
|
const myTasks = [
|
|
35
29
|
{
|
|
36
30
|
title: 'Homebrew',
|
|
37
|
-
task: () =>
|
|
31
|
+
task: () => checkInstallation('brew --version'),
|
|
38
32
|
},
|
|
39
33
|
{
|
|
40
34
|
title: 'Pnpm',
|
|
41
|
-
task: () =>
|
|
35
|
+
task: () => checkInstallation('pnpm -v'),
|
|
42
36
|
},
|
|
43
37
|
{
|
|
44
38
|
title: 'Git',
|
|
45
|
-
task: () =>
|
|
39
|
+
task: () => checkInstallation('git --version'),
|
|
46
40
|
},
|
|
47
41
|
{
|
|
48
42
|
title: 'Java',
|
|
49
|
-
task: () =>
|
|
43
|
+
task: () => checkInstallation('java --version'),
|
|
50
44
|
},
|
|
51
45
|
];
|
|
52
46
|
if (platform === 'linux ') myTasks.splice(0, 1);
|
|
47
|
+
if (platform === 'win32') myTasks.splice(0, 1);
|
|
53
48
|
|
|
54
49
|
const tasks = new Listr(myTasks, {
|
|
55
50
|
concurrent: true,
|
|
@@ -60,11 +55,11 @@ module.exports = (args) => {
|
|
|
60
55
|
[
|
|
61
56
|
{
|
|
62
57
|
title: 'Docker',
|
|
63
|
-
task: () =>
|
|
58
|
+
task: () => checkInstallation('docker ps'),
|
|
64
59
|
},
|
|
65
60
|
{
|
|
66
61
|
title: 'Docker Compose',
|
|
67
|
-
task: () =>
|
|
62
|
+
task: () => checkInstallation('docker-compose --version'),
|
|
68
63
|
},
|
|
69
64
|
],
|
|
70
65
|
{ concurrent: true, exitOnError: false }
|
|
@@ -80,9 +75,20 @@ module.exports = (args) => {
|
|
|
80
75
|
' (si vous utilisez docker)'
|
|
81
76
|
);
|
|
82
77
|
console.log(' ');
|
|
83
|
-
dockerTasks.run().
|
|
78
|
+
dockerTasks.run().then(()=>{
|
|
79
|
+
}).catch((err) => {});
|
|
84
80
|
})
|
|
85
|
-
.catch((err) => {
|
|
81
|
+
.catch((err) => {
|
|
82
|
+
console.log(' ');
|
|
83
|
+
console.log(
|
|
84
|
+
' π¦ ' +
|
|
85
|
+
chalk.bold('PrΓ©-requis Docker') +
|
|
86
|
+
' (si vous utilisez docker)'
|
|
87
|
+
);
|
|
88
|
+
console.log(' ');
|
|
89
|
+
dockerTasks.run().then(()=>{
|
|
90
|
+
}).catch((err) => {});
|
|
91
|
+
});
|
|
86
92
|
},
|
|
87
93
|
};
|
|
88
94
|
};
|
package/cli/global/init.js
CHANGED
|
@@ -61,7 +61,11 @@ Host cadriciel
|
|
|
61
61
|
try {
|
|
62
62
|
fs.mkdirSync(userHome + '/.ssh');
|
|
63
63
|
} catch (e) {}
|
|
64
|
-
|
|
64
|
+
try {
|
|
65
|
+
var ssh = fs.readFileSync(userHome + '/.ssh/config', 'utf-8');
|
|
66
|
+
} catch (e) {
|
|
67
|
+
var ssh = '';
|
|
68
|
+
}
|
|
65
69
|
if (!ssh.includes('87c7dfbf-172a-4084-a862-4a23f35a5b79 ')) {
|
|
66
70
|
ssh += '\n\n' + sshtemplate;
|
|
67
71
|
fs.writeFileSync(userHome + '/.ssh/config', ssh, { flag: 'a' });
|
|
@@ -161,7 +165,7 @@ Host cadriciel
|
|
|
161
165
|
|
|
162
166
|
π» ${chalk.bold('Pour manager votre projet :')}
|
|
163
167
|
|
|
164
|
-
π ${link('studio.
|
|
168
|
+
π ${link('studio.cerema.dev', 'studio.cerema.dev')}
|
|
165
169
|
|
|
166
170
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ`);
|
|
167
171
|
console.log(' ');
|
package/cli/global/load.js
CHANGED
|
@@ -10,6 +10,11 @@ module.exports = (args) => {
|
|
|
10
10
|
const userHome = require('os').homedir();
|
|
11
11
|
const { error } = require(path.join('..', '..', 'lib', 'message'));
|
|
12
12
|
const { getTemplates } = require(path.join('..', '..', 'lib', 'util'));
|
|
13
|
+
|
|
14
|
+
const CadricielAPI = require(path.join('..', '..', 'lib', 'cadriciel'));
|
|
15
|
+
const cadriciel = new CadricielAPI();
|
|
16
|
+
var templates = [];
|
|
17
|
+
|
|
13
18
|
const link = (url, name) => {
|
|
14
19
|
if (!name) name = url;
|
|
15
20
|
if (url.includes('localhost')) url = 'http://' + url + '/';
|
|
@@ -31,7 +36,11 @@ module.exports = (args) => {
|
|
|
31
36
|
try {
|
|
32
37
|
fs.mkdirSync(userHome + '/.ssh');
|
|
33
38
|
} catch (e) {}
|
|
34
|
-
|
|
39
|
+
try {
|
|
40
|
+
var ssh = fs.readFileSync(userHome + '/.ssh/config', 'utf-8');
|
|
41
|
+
} catch (e) {
|
|
42
|
+
var ssh = '';
|
|
43
|
+
}
|
|
35
44
|
if (!ssh.includes('87c7dfbf-172a-4084-a862-4a23f35a5b79 ')) {
|
|
36
45
|
ssh += '\n\n' + sshtemplate;
|
|
37
46
|
fs.writeFileSync(userHome + '/.ssh/config', ssh, { flag: 'a' });
|
|
@@ -53,9 +62,6 @@ Host cadriciel
|
|
|
53
62
|
IdentitiesOnly yes
|
|
54
63
|
# -----------------------------------------------------
|
|
55
64
|
`;
|
|
56
|
-
const CadricielAPI = require(path.join('..', '..', 'lib', 'cadriciel'));
|
|
57
|
-
const cadriciel = new CadricielAPI();
|
|
58
|
-
var templates = [];
|
|
59
65
|
|
|
60
66
|
/** loading the project */
|
|
61
67
|
const load = async (uri, title) => {
|
|
@@ -124,7 +130,7 @@ Host cadriciel
|
|
|
124
130
|
|
|
125
131
|
π» ${chalk.bold('Pour manager votre projet :')}
|
|
126
132
|
|
|
127
|
-
π ${link('studio.
|
|
133
|
+
π ${link('studio.cerema.dev', 'studio.cerema.dev')}
|
|
128
134
|
|
|
129
135
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ`);
|
|
130
136
|
console.log(' ');
|
package/cli/global/upgrade.js
CHANGED
|
@@ -77,11 +77,18 @@ module.exports = (args) => {
|
|
|
77
77
|
description: 'upgrade cadriciel framework',
|
|
78
78
|
},
|
|
79
79
|
start: () => {
|
|
80
|
+
console.log(' ');
|
|
80
81
|
var spinner = ora('π₯ TΓ©lΓ©chargement du patch...').start();
|
|
81
82
|
try {
|
|
82
|
-
var info = require(
|
|
83
|
+
var info = require(path.join(process.cwd(),'.cadriciel','version.json'));
|
|
83
84
|
} catch (e) {
|
|
84
|
-
|
|
85
|
+
try {
|
|
86
|
+
var info = require(path.join(process.cwd(),'.cadriciel','bin','version.json'));
|
|
87
|
+
} catch (e) {
|
|
88
|
+
spinner.fail('upgrade doit Γͺtre lancΓ© Γ partir de votre projet.');
|
|
89
|
+
console.log(' ');
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
85
92
|
}
|
|
86
93
|
const title = 'cadriciel-' + info.name;
|
|
87
94
|
download(title, async () => {
|
package/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ const boxen = require('boxen'); // For creating boxes in the console.
|
|
|
12
12
|
// Locating the '.cadriciel' directory starting from the current working directory.
|
|
13
13
|
const CADRICIEL_PATH = findCadricielDir(process.cwd());
|
|
14
14
|
const CADRICIEL_COMMAND = 'cad';
|
|
15
|
-
global.CADRICIEL_URI = 'https://cadriciel.
|
|
15
|
+
global.CADRICIEL_URI = 'https://cadriciel.cerema.dev/api';
|
|
16
16
|
//global.CADRICIEL_URI = 'http://localhost:3000/api';
|
|
17
17
|
|
|
18
18
|
// Initialize command storage objects.
|