Open ajryan opened 9 years ago
awesome, thanks!
@ajryan Can you also update the readme file for this new usages?
Will do! Thanks for reviewing this so quickly.
OK, index.js
cleaned up and README.md
updated. Thanks for this tool!
@ajryan thanks again! I'm trying this out now but I'm seeing abnormal endless loop if you have a failing restore task:
We should terminate the loop and the process if we have any errors while running the commands. Not sure it is there now for the released version but it wasn't that annoying as there wasn't an endless loop :smile:
I think it's actually k web
that is failing in your example, although the same can happen for kpm restore
. The released version will loop if you have an error in Startup.cs
. When I first started using this task, I actually thought of it as kind of a feature - once I fixed the issue, the app was running again without any intervention.
I suppose it could be better to terminate the loop if any command ends in error, and only loop when k run
terminates normally due to file change.
What do you think?
I suppose it could be better to terminate the loop if any command ends in error, and only loop when
k run
terminates normally due to file change.
Yes + AFAIK, k run --watch
still returns zero code when there are file changes. I could be mistaken, though. So, it will be easy to know when it fails and when the file is changing. Do you think that you can this implementation in here as well?
I think so - will give it a shot.
I have an implementation ready that will terminate the loop if any command exits with a non-zero error code.
I'm new to gulp, so I'm not sure if terminating on error is really the right thing in a "live reload" environment. According to this article (link), the build should keep running on error, but I don't know what the general consensus is. Part of me thinks an additional terminateOnError
option should be added.
Of course it's up to you, I'm happy to push the commit that always terminates, or anything else you think is most appropriate.
This is useful in case project.json is modified - we can now kpm restore / k --watch all inside the loop. I also added a quiet option (on by default).