Create unique temp directories and clean up afterwards#370
Create unique temp directories and clean up afterwards#370SpoonMeiser wants to merge 3 commits intoinkle:masterfrom
Conversation
|
Thanks for this! I have a couple of questions, if you don't mind?
|
|
Unfortunately I'm only able to test on Linux Instead of using The behaviour if the function doesn't exist is an error message in the console, and the directory not being deleted, which isn't very different from the current behaviour, although potentially more annoying to manually cleanup now if there are multiple temp directories lying about. |
For compatability with older versions of node
|
I've added a new commit that adds |
|
Also, although this replaces the changes from #223, I did test that this does still respect TMPDIR on Linux (and I assume also OSX) |
Use
os.tmpdirandfs.mkdtempto create a uniquely named temporary directory in the correct place.Also attempt to remove the temporary directory on application exit. This uses
fs.rmSyncwhich is only available in Node 14, which might be too new.