concurrently 2.1.0 → 2.2.0

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/kimmobrunfeldt/concurrently.svg)](https://travis-ci.org/kimmobrunfeldt/concurrently)
4
4
 
5
- **Version: 2.1.0** ([*previous stable*](https://github.com/kimmobrunfeldt/concurrently/tree/2.0.0))
5
+ **Version: 2.2.0** ([*previous stable*](https://github.com/kimmobrunfeldt/concurrently/tree/2.1.0))
6
6
 
7
7
  Run multiple commands concurrently.
8
8
  Like `npm run watch-js & npm run watch-less` but better.
@@ -45,8 +45,9 @@ Options:
45
45
  -V, --version output the version number
46
46
  -k, --kill-others kill other processes if one exits or dies
47
47
  --no-color disable colors from logging
48
+ --names names different processes, i.e --name "web,api,hot-server" to be used in the prefix switch
48
49
  -p, --prefix <prefix> prefix used in logging for each process.
49
- Possible values: index, pid, time, command, none or a template. Default: index. Example template "{time}-{pid}"
50
+ Possible values: index, pid, time, command, name, none or a template. Default: index. Example template "{time}-{pid}"
50
51
 
51
52
  -tf, --timestamp-format <format> specify the timestamp in moment format. Default: YYYY-MM-DD HH:mm:ss.SSS
52
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "concurrently",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Run commands concurrently",
5
5
  "main": "src/main.js",
6
6
  "bin": {
package/src/main.js CHANGED
@@ -8,6 +8,7 @@ var program = require('commander');
8
8
  var _ = require('lodash');
9
9
  var chalk = require('chalk');
10
10
  var spawn = Promise.promisifyAll(require('cross-spawn'));
11
+ var isWindows = /^win/.test(process.platform);
11
12
 
12
13
  var config = {
13
14
  // Kill other processes if one dies
@@ -209,6 +210,9 @@ function run(commands) {
209
210
  var parts = separateCmdArgs(cmd);
210
211
 
211
212
  var spawnOpts = config.raw ? {stdio: 'inherit'} : {};
213
+ if (isWindows) {
214
+ spawnOpts.detached = false;
215
+ }
212
216
  var child;
213
217
  try {
214
218
  child = spawn(_.head(parts), _.tail(parts), spawnOpts);
@@ -306,7 +310,11 @@ function handleClose(streams, children, childrenInfo) {
306
310
 
307
311
  // Send SIGTERM to alive children
308
312
  _.each(aliveChildren, function(child) {
309
- child.kill();
313
+ if (isWindows) {
314
+ spawn('taskkill', ["/pid", child.pid, '/f', '/t']);
315
+ } else {
316
+ child.kill('SIGINT');
317
+ }
310
318
  });
311
319
  });
312
320
  }
@@ -41,7 +41,7 @@ describe('concurrently', function() {
41
41
  });
42
42
 
43
43
  it('at least one unsuccessful commands should exit non-zero', function(done) {
44
- run('node ./src/main.js "echo" "exit 1" "echo"', {pipe: DEBUG_TESTS})
44
+ run('node ./src/main.js "echo" "return 1" "echo"', {pipe: DEBUG_TESTS})
45
45
  .then(function(exitCode) {
46
46
  assert.notStrictEqual(exitCode, 0);
47
47
  done();