Node.js process triggered with watcher exits with 1 but VS code still shows Success in green
Im triggering my own build tool with yarn lincd build-updated which is a little node.js program.
When I have build errors the process ends with process.exit(1) however VS code still shows a green "Success" in the bottom.
Why is it not triggering "Error" state? Should I configure the watcher different or is this something that can be fixed/improved?
"settings": {
"filewatcher.commands": [
{
"match": "./packages/.*",
"isAsync": false,//we need to wait for the build to finish before it's called again - to avoid double builds
"cmd": "cd ${workspaceRoot} && yarn lincd build-updated",
"event": "onFileChange"
}
]
},
@LINCD-admin Hi! Currently, the extension only captures errors written to stderr. Checking process exit codes is not yet supported, but might be considered in the future. As a workaround, you can add console.error:
console.error('error message');
process.exit(1);
gotcha, that's helpful. Thanks!
ps yes I think it would be helpful to detect process.exit(1) as an error. I've managed to fix one tool console.error but the same came up with another tool that I don't own. it's pretty common behavior to use process.exit(1)