(pathname, useSpawn)
| 9 | let escapePOSIXShell; |
| 10 | |
| 11 | function rmSync(pathname, useSpawn) { |
| 12 | if (useSpawn) { |
| 13 | if (isUnixLike) { |
| 14 | escapePOSIXShell ??= require('./index.js').escapePOSIXShell; |
| 15 | for (let i = 0; i < 3; i++) { |
| 16 | const { status } = spawnSync(...escapePOSIXShell`rm -rf "${pathname}"`); |
| 17 | if (status === 0) { |
| 18 | break; |
| 19 | } |
| 20 | } |
| 21 | } else { |
| 22 | spawnSync( |
| 23 | process.execPath, |
| 24 | [ |
| 25 | '-e', |
| 26 | `fs.rmSync(${JSON.stringify(pathname)}, { maxRetries: 3, recursive: true, force: true });`, |
| 27 | ], |
| 28 | ); |
| 29 | } |
| 30 | } else { |
| 31 | fs.rmSync(pathname, { maxRetries: 3, recursive: true, force: true }); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | const testRoot = process.env.NODE_TEST_DIR ? |
| 36 | fs.realpathSync(process.env.NODE_TEST_DIR) : path.resolve(__dirname, '..'); |
no test coverage detected
searching dependent graphs…