vovk 0.2.3-beta.41 → 0.2.3-beta.42

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.
Files changed (2) hide show
  1. package/cli/concurrent.js +9 -12
  2. package/package.json +1 -1
package/cli/concurrent.js CHANGED
@@ -9,7 +9,7 @@ function concurrent(commands) {
9
9
  commands.forEach((cmd) => {
10
10
  const processObj = {
11
11
  name: cmd.name,
12
- process: runCommand(cmd.command, cmd.name, (code) => handleProcessExit(code, cmd.name, resolve, reject)),
12
+ process: runCommand(cmd.command, cmd.name, (code) => handleProcessExit(code, cmd.name)),
13
13
  };
14
14
  processes.push(processObj);
15
15
  });
@@ -22,20 +22,17 @@ function concurrent(commands) {
22
22
  return proc;
23
23
  }
24
24
 
25
- function handleProcessExit(code, name, resolve, reject) {
26
- if (!processes.length) {
27
- // resolved or rejected already
28
- return;
29
- }
30
-
31
- processes.forEach((p) => p.name !== name && p.process.kill());
25
+ function handleProcessExit(code, name) {
26
+ processes = processes.filter((p) => p.name !== name);
32
27
 
33
- processes = [];
28
+ if (code !== 0) {
29
+ processes.forEach((p) => p.process.kill());
30
+ processes = [];
31
+ return reject(new Error(`Process exited with code ${code}`));
32
+ }
34
33
 
35
- if (code === 0) {
34
+ if (!processes.length) {
36
35
  resolve();
37
- } else {
38
- reject(new Error(`Process exited with code ${code}`));
39
36
  }
40
37
  }
41
38
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk",
3
- "version": "0.2.3-beta.41",
3
+ "version": "0.2.3-beta.42",
4
4
  "description": "Structural add-on for Next.js",
5
5
  "bin": "./cli/index.js",
6
6
  "scripts": {