@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.
@@ -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
@@ -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 { exec } = require('child_process');
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
- chalk.grey(' (subcommands: ') +
90
- chalk.cyan(sc.join(', ')) +
91
- chalk.grey(')');
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
- const cmd = `node ${CADRICIEL_PATH}/${command} ${args.splice(1).join(' ')}`;
159
- exec(cmd, (error, stdout, stderr) => {
160
- if (error) {
161
- console.error(`Erreur d'exécution de la commande: ${error.message}`);
162
- return;
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerema/cadriciel",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "npm": ">=8.0.0",