Comments (5)
Or you meant detached
from here: https://nodejs.org/api/child_process.html ?
from grunt-exec.
You are correct. Have not updated the docs yet. Needs more testing to cover some edge cases (as discovered in #79) before release since it was a major change switching from exec to spawn.
from grunt-exec.
@gwicksted, thanks. Initially, I've thought about a different scenario, and to be honest, I'm still looking for the appropriate solution for this and I want to share my problem.
Imagine, I've got several 3rd-party CLI tools supporting --watch
mode. Usually, it means that whenever I run them, they do a full amount of work and then start watching for individual file changes.
tsc -p path/to/tsconfig.json --watch
webpack --config path/to/webpack.dev.config.js --watch
karma start path/to/karma.conf.js --auto-watch
For me it looks perfectly fine to write accordingly three tasks: exec:ts-watch
, exec:webpack-watch
, exec:karma-watch
, but it looks like that grunt-ts
does not support yet some kind of "detachment" from its tasks that I need in my case. Maybe I'm wrong.
I mean that if write:
grunt.registerTask('serve', ['exec:ts-watch', 'exec:webpack-watch', 'exec:karma-watch', 'watch:dev']);
I'll be stuck forever on 'exec:ts-watch'.
Instead, I would like to see some child process creation that will guarantee that after the parent grunt process is finished or killed, we'll also clean up after ourselves and kill all exec:*-watch
tasks. Once we created child process , we report that the task has finished its work. Ideally, the exact moment of done()
is nice to have under control in some options.afterChildProcessCreatedCallback
.
So, I've started some sort of experimenting here: https://github.com/noomorph/grunt-exec/commit/b10a95fdbf7279f08719b47af668ea7e4a547726#diff-f7fa85a898002b4e35a70421dcca8ab4R248
Maybe, you could advise me in which direction it is better to move?
from grunt-exec.
Might be overkill but forever
(npm here) gives you the flexibility to do just about anything with background processes. There is also an async task for grunt but that simply allows multiple tasks to be run in parallel and you probably want your terminal back after executing grunt... another option if you're in linux: try using screen
(gnu man) -- I haven't tried it with tsc
but I assume no compatibility issues. Then you can reattach with screen -r
or kill the pid to stop it.
from grunt-exec.
Thanks, @gwicksted . Your suggestions do not match my needs but I realized that using grunt-exec
in my case is not a right decision. I should be modifying grunt-ts
probably.
from grunt-exec.
Related Issues (20)
- exec failed to execute rpmbuild but the commands succeeds if run directly HOT 3
- Use a function to set the cwd HOT 2
- Do not execute Multiple cmd HOT 6
- If child is killed, task output should show the kill signal, not 'exited with 0' HOT 1
- Command working on shell but not with grunt-exec HOT 2
- Update Grunt dependency HOT 14
- Better error message when exceeding maxBuffer size HOT 5
- Document how to run multiple commands
- Support an array of commands to execute HOT 1
- Success after maxBuffer size is reached HOT 1
- Allow to pass function for cwd parameter HOT 1
- Unix combine commands with && does not work HOT 4
- WINDOWS REGRESSION: command with double-quotes cannot be executed HOT 6
- Redirecting command output to a file does not work ( using >> or > ) HOT 1
- Provide a changelog for 2.0.0 HOT 4
- Cannot perform command with quotes HOT 5
- stdin not work with inquirer HOT 1
- rsync with sshpass HOT 1
- $PATH with grunt exec HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-exec.