dbashford / mimosa

A lightning-fast, modular, next generation browser development tool.
http://mimosa.io/
519 stars 34 forks source link

Automatically restart mimosa when its config file changes #418

Closed mindjuice closed 9 years ago

mindjuice commented 9 years ago

During development, I frequently add new entries to my browserify:aliases list in mimosa-config.coffee. Currently, every time I do so, I have to remember to Alt-Tab over to Mimosa's window, do a Ctrl-C and then up arrow, then Enter to kill and restart mimosa.

It sounds like not much effort, but when I am creating several files and new aliases in a row, it's a bit annoying and I sometimes forget and wonder why things are not working.

It would be great if mimosa could watch its own config file and then restart itself with the same arguments as it was initially run with. This could be an option in the config or the default.

Anachron commented 9 years ago

Mimosa should automatically do that :-) You sure you didnt disable it? What OS are you using?

dbashford commented 9 years ago

That's not in mimosa.

There is a module: https://github.com/dbashford/mimosa-restart that could probably be augmented to watch the config. Right now it just monitors your public directory and if it disappears it restarts mimosa in-process.

dbashford commented 9 years ago

I've included that functionality in mimosa-restart.

So, add "restart" to your modules and the below to your config and you'll restart when the mimosa-config.js updates.

restart: {
  updated:["mimosa-config.js"]
}
mindjuice commented 9 years ago

That's awesome, thanks! I had just been looking through the code yesterday and was going to try and find some time to tackle it myself!

Much appreciated!

Ken Sent from my iPhone

On Dec 15, 2014, at 12:00 PM, David Bashford notifications@github.com wrote:

I've included that functionality in mimosa-restart.

So, add "restart" to your modules and the below to your config and you'll restart when the mimosa-config.js updates.

restart: { updated:["mimosa-config.js"] } — Reply to this email directly or view it on GitHub.