Skip to content

Commit

Permalink
fix: kill SIGINT signal at man for marked --help
Browse files Browse the repository at this point in the history
  • Loading branch information
NOMADE55 committed Oct 10, 2024
1 parent 2898bf0 commit 4501be7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bin/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ export async function main(nodeProcess) {
const helpText = await readFile(resolve(__dirname, '../man/marked.1.md'), 'utf8');

await new Promise(res => {
spawn('man', [resolve(__dirname, '../man/marked.1')], options)
.on('error', () => {
console.log(helpText);
const manProcess = spawn('man', [resolve(__dirname, '../man/marked.1')], options);
nodeProcess.on('SIGINT', () => {
manProcess.kill('SIGINT');
});

manProcess.on('error', () => {
console.log(helpText);
})

Check failure on line 45 in bin/main.js

View workflow job for this annotation

GitHub Actions / OtherTests

Expected indentation of 6 spaces but found 8
.on('close', res);
});
Expand Down

0 comments on commit 4501be7

Please # to comment.