@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.
@@ -2,7 +2,7 @@ module.exports = (args) => {
2
2
  return {
3
3
  info: {
4
4
  title: 'project',
5
- description: `Gestion de votre projet `,
5
+ description: 'Gestion de votre projet (mise à jour,logo) ',
6
6
  sub: [
7
7
  {
8
8
  title: 'api',
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 { exec } = require('child_process');
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
- chalk.grey(' (subcommands: ') +
91
- chalk.cyan(sc.join(', ')) +
92
- chalk.grey(')');
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
- const cmd = `node ${CADRICIEL_PATH}/${command} ${args.splice(1).join(' ')}`;
160
- exec(cmd, (error, stdout, stderr) => {
161
- if (error) {
162
- console.error(`Erreur d'exécution de la commande: ${error.message}`);
163
- return;
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerema/cadriciel",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "npm": ">=8.0.0",