javascript - Grunt run try catch and run shell command on error -


i grunt 'catch' grunt error , run shell command , try again.

here's specific use case.

after error.

[4mrunning "connect:livereload" (connect) task[24m] [31mfatal error: port 9000 in use process.[39m] [finished in 13.4s exit code 1] 

i run following shell command

lsof -p | grep ':9000' | awk '{print $2}' | xargs kill -9 

to kill 'in use port' before trying again

grunt-exec allow me execute shell commands haven't found plugin (or other method) let me catch error.

i welcome ideas use either grunt or shell solve problem.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -