fix: kill SIGINT signal at man for marked --help (#3483)
This commit is contained in:
parent
9c8c82cd65
commit
b1fd3eafd8
12
bin/main.js
12
bin/main.js
@ -35,10 +35,14 @@ export async function main(nodeProcess) {
|
|||||||
const helpText = await readFile(resolve(__dirname, '../man/marked.1.md'), 'utf8');
|
const helpText = await readFile(resolve(__dirname, '../man/marked.1.md'), 'utf8');
|
||||||
|
|
||||||
await new Promise(res => {
|
await new Promise(res => {
|
||||||
spawn('man', [resolve(__dirname, '../man/marked.1')], options)
|
const manProcess = spawn('man', [resolve(__dirname, '../man/marked.1')], options);
|
||||||
.on('error', () => {
|
nodeProcess.on('SIGINT', () => {
|
||||||
console.log(helpText);
|
manProcess.kill('SIGINT');
|
||||||
})
|
});
|
||||||
|
|
||||||
|
manProcess.on('error', () => {
|
||||||
|
console.log(helpText);
|
||||||
|
})
|
||||||
.on('close', res);
|
.on('close', res);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user