diff --git a/packages/nx/bin/nx.ts b/packages/nx/bin/nx.ts index d8a6a0f62b..cba4fe9946 100644 --- a/packages/nx/bin/nx.ts +++ b/packages/nx/bin/nx.ts @@ -283,26 +283,8 @@ const getLatestVersionOfNx = ((fn: () => string) => { return () => cache || (cache = fn()); })(_getLatestVersionOfNx); -function nxCleanup(signal?: NodeJS.Signals) { - removeDbConnections(); - if (signal) { - process.exit(signalToCode(signal)); - } else { - process.exit(); - } -} - process.on('exit', () => { - nxCleanup(); -}); -process.on('SIGINT', () => { - nxCleanup('SIGINT'); -}); -process.on('SIGTERM', () => { - nxCleanup('SIGTERM'); -}); -process.on('SIGHUP', () => { - nxCleanup('SIGHUP'); + removeDbConnections(); }); main();