-
Couldn't load subscription status.
- Fork 60
Add CoffeeScript support & add synchronous foreground process support... #7
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
Conversation
Adding cmd: 'coffee' to your options allows you to run a script using coffeescript...
When running a foreground task, wait for SIGINT to be signaled before stopping the server
|
I added another commit because I need the ability to stop a foreground task explicitly using Ctrl+C (SIGINT). The trouble is I think that my express server is running asynchronously in its own I'm not sure if that this is the best method for doing this because you might want to just run some file to completion, but on the other hand probably 90% of express servers will run themselves asynchronously with node's whole callback model, so it seems to make sense do this...? Btw. The reason I'm doing this is because I'm running the express server in the foreground on production to avoid running the
I think the reason they don't just use Thanks! I appreciate any advice... |
|
Oh sorry by the way, I probably should have put the second commit in a separate branch, I'll split it up if you'd like... |
|
Ah actually I'm not sure capturing SIGINT is going to work well since it just prevents the server from being interrupted... still investigating... |
Run foreground express server similar to background express server, but wait for the spawn function to return when running in the foreground
|
Ok, I've changed the foreground method to work in a similar way to the background method, except that it blocks until the |
|
Sorry for the noise :) One more thing I wanted to mention: I also had a look at https://github.com/bustardcelly/grunt-forever but I couldn't quite make out if it would do what I wanted it to do, anyway I think if grunt-express-server has a foreground option available it should probably work like this |
… ending and the child process ending
Simplify the termination logic and distinguish between the grunt task ending and the child process ending
tasks/lib/server.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Common convention is to call this self, at least in grunt & yeoman.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I was wondering what the norm is
|
Let me know how you need me help on this! |
|
Thanks! Sorry, I'm a bit slow to read notifications on github. I'll update soon |
… so that it doesn't mutate the process environment
…erverEnv variable
|
Oh sorry for taking so long to update, it's a bit busy right now... I changed I see the travis-ci fails though on the |
|
I've been busy as well :) I'll check to see what it takes to get all tests running again. Could you provide me (since I don't see it in the PR) what you want to be ran instead? I'm assuming instead of I can tell this change requires spawning a process no matter if |
|
I think I resolved synchronous in If you could clarify the final command you expect to be spawned per my previous comment, we can continue this PR (and I may merge your commits with |
|
Oh thanks, sorry for not responding!! |
|
Sorry Eric I have trouble even remembering the details of this - we are actually actively using it in our startup, so I'd certainly like to track grunt-express-server origin. Next time I pull from grunt-express-server I'll revisit, looking at #10 and maybe submit a fresh PR. |
|
I'm getting your updates & a coffeescript version of genesis skeleton working together. It'll be tricky, but your code will make it much easier! (Closing so I can reuse this PR in Talk to you soon! |
Hi, this is a very small patch, just lets you specify the command to use as 'coffee' instead of 'node' when running the (express) server script...
Please let me know if it looks ok?