Conversation
| private void LaunchStopScriptMacOS() | ||
| { | ||
| var fileName = Guid.NewGuid().ToString("N") + ".sh"; | ||
| var scriptPath = Path.Combine(AppContext.BaseDirectory, fileName); |
There was a problem hiding this comment.
Why write it into the app directory? Could it go into a temp directory instead?
Reason: if for some reason this fails or takes a nontrivial amount of time to run, it will show up as a file in source control. Or if there is some file watcher (e.g., hot reload), it's going to trigger some action.
There was a problem hiding this comment.
AppContext.BaseDirectory points to the bin\Debug\net6.0 folder
There was a problem hiding this comment.
Ok, sounds fine then. I’m not certain how spaces in the path would be handled on macOS but assuming the script will still get executed in this case, all good!
SteveSandersonMS
left a comment
There was a problem hiding this comment.
There were a few things I'm unsure about and have posted comments, but the overall approach looks great and I'm sure you'll make good choices about how/whether to address the comments.
…en the host dotnet process is ungracefully terminated.
ccaa25e to
9738d37
Compare
|
/backport to release/6.0-rc1 |
|
Started backporting to release/6.0-rc1: https://github.com/dotnet/aspnetcore/actions/runs/1166604471 |
Adds a script to terminate the spawned NPM processes automatically when the host dotnet process is ungracefully terminated in the same way its done on windows.
The script watches every second that the parent dotnet process is still running and when it detects it is not longer doing so, it lists all kills all the spawned node processes.