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

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -