MCPcopy Index your code
hub / github.com/nodejs/node / onexit

Function onexit

test/common/tmpdir.js:59–82  ·  view source on GitHub ↗
(useSpawn)

Source from the content-addressed store, hash-verified

57}
58
59function onexit(useSpawn) {
60 // Change directory to avoid possible EBUSY
61 if (isMainThread)
62 process.chdir(testRoot);
63
64 try {
65 rmSync(tmpPath, useSpawn);
66 } catch (e) {
67 console.error('Can\'t clean tmpdir:', tmpPath);
68
69 const files = fs.readdirSync(tmpPath);
70 console.error('Files blocking:', files);
71
72 if (files.some((f) => f.startsWith('.nfs'))) {
73 // Warn about NFS "silly rename"
74 console.error('Note: ".nfs*" might be files that were open and ' +
75 'unlinked but not closed.');
76 console.error('See http://nfs.sourceforge.net/#faq_d2 for details.');
77 }
78
79 console.error();
80 throw e;
81 }
82}
83
84function resolve(...paths) {
85 return path.resolve(tmpPath, ...paths);

Callers 1

refreshFunction · 0.70

Calls 5

chdirMethod · 0.80
someMethod · 0.80
rmSyncFunction · 0.70
errorMethod · 0.45
readdirSyncMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…