@cerema/cadriciel 1.2.1 → 1.2.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.
- package/cli/cadriciel/project.js +1 -1
- package/cli.js +13 -16
- package/package.json +1 -1
package/cli/cadriciel/project.js
CHANGED
package/cli.js
CHANGED
|
@@ -4,7 +4,7 @@ const chalk = require('chalk-v2');
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const log = require('log-beautify');
|
|
6
6
|
const path = require('path');
|
|
7
|
-
const {
|
|
7
|
+
const { spawn } = require('child_process');
|
|
8
8
|
|
|
9
9
|
const CADRICIEL_PATH = findCadricielDir(process.cwd());
|
|
10
10
|
const CADRICIEL_COMMAND =
|
|
@@ -86,10 +86,10 @@ const display = (commands) => {
|
|
|
86
86
|
for (let i = 0; i < commands[el].info.sub.length; i++) {
|
|
87
87
|
sc.push(commands[el].info.sub[i].title);
|
|
88
88
|
}
|
|
89
|
-
description +=
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
description += chalk.white(' ');
|
|
90
|
+
description += chalk.grey(' (subcommands: ');
|
|
91
|
+
description += chalk.cyan(sc.join(', '));
|
|
92
|
+
description += chalk.grey(')');
|
|
93
93
|
}
|
|
94
94
|
const dots = '.'.repeat(maxWidth - title.length);
|
|
95
95
|
|
|
@@ -156,18 +156,15 @@ const processCommands = (args) => {
|
|
|
156
156
|
}
|
|
157
157
|
CADRICIEL_GLOBAL_COMMANDS[command].start(args);
|
|
158
158
|
} else {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if (stderr) {
|
|
166
|
-
console.error(`Erreur: ${stderr}`);
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
console.log(stdout);
|
|
159
|
+
console.log(' ');
|
|
160
|
+
const cmd = `node`;
|
|
161
|
+
const fullArgs = [`${CADRICIEL_PATH}/${command}`, ...args.splice(1)];
|
|
162
|
+
|
|
163
|
+
const child = spawn(cmd, fullArgs, {
|
|
164
|
+
stdio: 'inherit',
|
|
170
165
|
});
|
|
166
|
+
|
|
167
|
+
child.on('close', (code) => {});
|
|
171
168
|
}
|
|
172
169
|
};
|
|
173
170
|
|