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