tsc-files icon indicating copy to clipboard operation
tsc-files copied to clipboard

File can be left over if process is terminated before cleanup happens

Open resolritter opened this issue 2 years ago • 1 comments

Problem: the process might be terminated before the temporary config cleanup is done

https://github.com/gustavopch/tsc-files/blob/27a82464f2c0ff26ccb5b5b152b589aa580bd5a6/lib/index.js#L54

When that happens - and I've had that happen multiple times e.g. when hitting Ctrl-C (SIGINT) on a parent process - the file will not be cleaned up properly.

Solution: attach listeners on termination signals for cleaning up the file when the process exits (https://nodejs.org/api/process.html#signal-events)

resolritter avatar Mar 20 '22 14:03 resolritter

I plan to open a pull request for this soon

resolritter avatar Mar 20 '22 14:03 resolritter

I have just stumbled on this issue. The possible PR is in my fork of your repo: https://github.com/gustavopch/tsc-files/pull/48

ypapouski avatar Nov 04 '22 12:11 ypapouski

Could either https://github.com/gustavopch/tsc-files/pull/28 or https://github.com/gustavopch/tsc-files/pull/48 be checked and merged so this issue can be resolved?

stevan-borus avatar Jul 03 '23 15:07 stevan-borus

Fixed in https://github.com/gustavopch/tsc-files/releases/tag/v1.1.4. Sorry for the long delay.

gustavopch avatar Jul 04 '23 13:07 gustavopch