Skip to content

Commit

Permalink
committing all files
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgo committed Oct 28, 2020
1 parent aec6886 commit 55d6971
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
6 changes: 0 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
"plugin:typescript-sort-keys/recommended"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-implied-eval": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"simple-import-sort/sort": "error"
},
"parserOptions": {
Expand Down
25 changes: 12 additions & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import deb from "debug";
import psTree from "ps-tree";
import util from "util";
const debug = deb("end-child-processes");
const psTreeA = util.promisify(psTree);
import deb from "debug"
import psTree from "ps-tree"
import util from "util"
const debug = deb("end-child-processes")
const psTreeA = util.promisify(psTree)

export async function endChildProcesses(): Promise<void> {
const children = await psTreeA(process.pid);
const children = await psTreeA(process.pid)
for (const child of children) {
if (child.COMMAND === "ps") {
continue;
continue
}
const processID = parseInt(child.PID, 10);
debug(`ending child process ${processID}: ${child.COMMAND}`);
const processID = parseInt(child.PID, 10)
debug(`ending child process ${processID}: ${child.COMMAND}`)
try {
process.kill(processID);
process.kill(processID)
} catch (e) {
debug(
`cannot kill process ${processID} (${child.COMMAND}): ${e.message}`
);
// eslint-disable-next-line
debug(`cannot kill process ${processID} (${child.COMMAND}): ${e.message}`)
}
}
}

0 comments on commit 55d6971

Please sign in to comment.