Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PID-tracking / kill-signal support #20

Open
ELLIOTTCABLE opened this issue Dec 7, 2015 · 6 comments
Open

PID-tracking / kill-signal support #20

ELLIOTTCABLE opened this issue Dec 7, 2015 · 6 comments

Comments

@ELLIOTTCABLE
Copy link

So, this might be a little out-of-scope, but I figured I'd point out it's a desirous feature:

It'd be nice if chokidar could automatically kill (or better yet, send an arbitrary single to) the previous invocation when it starts a new one. (For instance, when a test-file is changed before a long-running test suite is complete; or in my particular use-case, allowing me to wrap the desired command in less and wanting the less-instance to be killed when chokidar invokes a new instance of the command.)

@kimmobrunfeldt
Copy link
Collaborator

I think this would be a good addition to chokidar-cli and I'm willing to merge a PR if someone wants to implement this feature.

@OliverJAsh
Copy link

If it helps anyone, nodemon does this out of the box, e.g.:

nodemon --watch . --exec "eslint --cache ."

@gagan-bansal
Copy link

I achieved it by adding few scripts in package.json

"scripts": {
    "start": "node myapp.js",
    "kill": "pkill -f myapp.js",
    "restart": "npm run kill; npm run start;",
    "watch": "./node_modules/.bin/chokidar --initial '**/*.js' -c 'npm run restart'"
}

Now just run:

npm run watch

@SalathielGenese
Copy link

PING here

@kimmobrunfeldt
Copy link
Collaborator

PR welcome for this feature 👍

@cameronbraid
Copy link

There is an old PR with this implemented #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants