Skip to content

Commit 0c9092c

Browse files
committed
fix: aborter before exit
1 parent c3a7fd0 commit 0c9092c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/run-script.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,12 @@ export async function runScript(filename: string, options: IRunScriptOptions) {
194194
let script
195195
const aborter = new AbortController()
196196
process.once('SIGINT', () => {
197-
aborter.abort()}
198-
)
197+
aborter.abort()
198+
})
199+
200+
process.once('exit', function () {
201+
aborter.abort()
202+
})
199203

200204
try {
201205
script = await AIScriptEx.loadFile(filename,

0 commit comments

Comments
 (0)