@cerema/cadriciel 1.4.11 → 1.4.13
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/_install.js +2 -2
- package/cli/global/install.js +25 -21
- package/cli.js +4 -1
- package/package.json +1 -1
package/cli/global/_install.js
CHANGED
|
@@ -24,7 +24,7 @@ module.exports = (args) => {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const checkIfCommandExists = (command, callback) => {
|
|
27
|
-
const proc = spawn('which', [command]);
|
|
27
|
+
const proc = spawn('which', [command], { shell: true });
|
|
28
28
|
|
|
29
29
|
let found = false;
|
|
30
30
|
proc.stdout.on('data', (data) => {
|
|
@@ -47,7 +47,7 @@ module.exports = (args) => {
|
|
|
47
47
|
const image = images[ndx];
|
|
48
48
|
|
|
49
49
|
const response = ora(`Téléchargement de l'image: ${image}`).start();
|
|
50
|
-
const dockerPull = spawn('docker', ['pull', image]);
|
|
50
|
+
const dockerPull = spawn('docker', ['pull', image], { shell: true });
|
|
51
51
|
|
|
52
52
|
dockerPull.stdout.on('data', (data) => {
|
|
53
53
|
//console.log(data.toString().trim());
|
package/cli/global/install.js
CHANGED
|
@@ -33,18 +33,17 @@ module.exports = (args) => {
|
|
|
33
33
|
const tasksDocker = new Listr([
|
|
34
34
|
{
|
|
35
35
|
title: 'Docker',
|
|
36
|
-
task: () => executeCommand('
|
|
36
|
+
task: () => executeCommand('brew install rancher-desktop'),
|
|
37
|
+
enabled: () => isMacOS || isLinux,
|
|
37
38
|
skip: () =>
|
|
38
|
-
executeCommand('docker ps').then(
|
|
39
|
-
() => 'Docker is already installed'
|
|
40
|
-
),
|
|
39
|
+
executeCommand('docker ps').then(() => 'Docker est déjà installé.'),
|
|
41
40
|
},
|
|
42
41
|
{
|
|
43
|
-
title: 'Docker
|
|
42
|
+
title: 'Docker',
|
|
43
|
+
enabled: () => isWindows,
|
|
44
|
+
task: () => installWithChocolatey('rancher-desktop'),
|
|
44
45
|
skip: () =>
|
|
45
|
-
executeCommand('docker
|
|
46
|
-
() => 'Docker Compose is already installed'
|
|
47
|
-
),
|
|
46
|
+
executeCommand('docker ps').then(() => 'Docker est déjà installé.'),
|
|
48
47
|
},
|
|
49
48
|
]);
|
|
50
49
|
const tasks = new Listr([
|
|
@@ -57,7 +56,7 @@ module.exports = (args) => {
|
|
|
57
56
|
),
|
|
58
57
|
skip: () =>
|
|
59
58
|
executeCommand('brew --version').then(
|
|
60
|
-
() => 'Homebrew
|
|
59
|
+
() => 'Homebrew est déjà installé.'
|
|
61
60
|
),
|
|
62
61
|
},
|
|
63
62
|
{
|
|
@@ -66,7 +65,7 @@ module.exports = (args) => {
|
|
|
66
65
|
task: () => executeCommand('brew install git'),
|
|
67
66
|
skip: () =>
|
|
68
67
|
executeCommand('git --version').then(
|
|
69
|
-
() => 'Git
|
|
68
|
+
() => 'Git est déjà installé.'
|
|
70
69
|
),
|
|
71
70
|
},
|
|
72
71
|
{
|
|
@@ -75,7 +74,7 @@ module.exports = (args) => {
|
|
|
75
74
|
task: () => executeCommand('brew install openjdk@17'),
|
|
76
75
|
skip: () =>
|
|
77
76
|
executeCommand('java -version').then(
|
|
78
|
-
() => 'Java (OpenJDK 17)
|
|
77
|
+
() => 'Java (OpenJDK 17) est déjà installé.'
|
|
79
78
|
),
|
|
80
79
|
},
|
|
81
80
|
{
|
|
@@ -83,7 +82,7 @@ module.exports = (args) => {
|
|
|
83
82
|
enabled: () => isMacOS || isLinux,
|
|
84
83
|
task: () => executeCommand('brew install maven'),
|
|
85
84
|
skip: () =>
|
|
86
|
-
executeCommand('mvn -v').then(() => 'Maven
|
|
85
|
+
executeCommand('mvn -v').then(() => 'Maven est déjà installé.'),
|
|
87
86
|
},
|
|
88
87
|
{
|
|
89
88
|
title: 'Install Liquibase',
|
|
@@ -91,7 +90,7 @@ module.exports = (args) => {
|
|
|
91
90
|
task: () => executeCommand('brew install liquibase'),
|
|
92
91
|
skip: () =>
|
|
93
92
|
executeCommand('liquibase --version').then(
|
|
94
|
-
() => 'Liquibase
|
|
93
|
+
() => 'Liquibase est déjà installé.'
|
|
95
94
|
),
|
|
96
95
|
},
|
|
97
96
|
{
|
|
@@ -103,7 +102,7 @@ module.exports = (args) => {
|
|
|
103
102
|
),
|
|
104
103
|
skip: () =>
|
|
105
104
|
executeCommand('choco -v').then(
|
|
106
|
-
() => 'Chocolatey
|
|
105
|
+
() => 'Chocolatey est déjà installé.'
|
|
107
106
|
),
|
|
108
107
|
},
|
|
109
108
|
{
|
|
@@ -112,7 +111,7 @@ module.exports = (args) => {
|
|
|
112
111
|
task: () => installWithChocolatey('git'),
|
|
113
112
|
skip: () =>
|
|
114
113
|
executeCommand('git --version').then(
|
|
115
|
-
() => 'Git
|
|
114
|
+
() => 'Git est déjà installé.'
|
|
116
115
|
),
|
|
117
116
|
},
|
|
118
117
|
{
|
|
@@ -121,7 +120,7 @@ module.exports = (args) => {
|
|
|
121
120
|
task: () => installWithChocolatey('openjdk17'),
|
|
122
121
|
skip: () =>
|
|
123
122
|
executeCommand('java -version').then(
|
|
124
|
-
() => 'Java (OpenJDK 17)
|
|
123
|
+
() => 'Java (OpenJDK 17) est déjà installé.'
|
|
125
124
|
),
|
|
126
125
|
},
|
|
127
126
|
{
|
|
@@ -129,7 +128,7 @@ module.exports = (args) => {
|
|
|
129
128
|
enabled: () => isWindows,
|
|
130
129
|
task: () => installWithChocolatey('maven'),
|
|
131
130
|
skip: () =>
|
|
132
|
-
executeCommand('mvn -v').then(() => 'Maven
|
|
131
|
+
executeCommand('mvn -v').then(() => 'Maven est déjà installé.'),
|
|
133
132
|
},
|
|
134
133
|
{
|
|
135
134
|
title: 'Install Liquibase (Windows)',
|
|
@@ -137,14 +136,19 @@ module.exports = (args) => {
|
|
|
137
136
|
task: () => installWithChocolatey('liquibase'),
|
|
138
137
|
skip: () =>
|
|
139
138
|
executeCommand('liquibase --version').then(
|
|
140
|
-
() => 'Liquibase
|
|
139
|
+
() => 'Liquibase est déjà installé.'
|
|
141
140
|
),
|
|
142
141
|
},
|
|
143
142
|
]);
|
|
144
143
|
|
|
145
|
-
tasks
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
tasks
|
|
145
|
+
.run()
|
|
146
|
+
.then(() => {
|
|
147
|
+
tasksDocker.run().catch((err) => {});
|
|
148
|
+
})
|
|
149
|
+
.catch((err) => {
|
|
150
|
+
console.error(err);
|
|
151
|
+
});
|
|
148
152
|
},
|
|
149
153
|
};
|
|
150
154
|
};
|
package/cli.js
CHANGED
|
@@ -25,7 +25,9 @@ try {
|
|
|
25
25
|
const checkVersion = async () => {
|
|
26
26
|
return new Promise((resolve, reject) => {
|
|
27
27
|
const packageName = '@cerema/cadriciel';
|
|
28
|
-
const child = spawn('npm', ['view', packageName, 'version']
|
|
28
|
+
const child = spawn('npm', ['view', packageName, 'version'], {
|
|
29
|
+
shell: true,
|
|
30
|
+
});
|
|
29
31
|
|
|
30
32
|
let version = '';
|
|
31
33
|
|
|
@@ -245,6 +247,7 @@ const processCommands = (args) => {
|
|
|
245
247
|
|
|
246
248
|
const child = spawn(cmd, fullArgs, {
|
|
247
249
|
stdio: 'inherit',
|
|
250
|
+
shell: true,
|
|
248
251
|
});
|
|
249
252
|
|
|
250
253
|
child.on('close', (code) => {});
|