(dir: string)
| 142 | } |
| 143 | |
| 144 | async function removeTempDir(dir: string): Promise<void> { |
| 145 | for (let attempt = 0; attempt < 10; attempt += 1) { |
| 146 | try { |
| 147 | await rm(dir, { recursive: true, force: true }); |
| 148 | return; |
| 149 | } catch (error) { |
| 150 | const code = (error as NodeJS.ErrnoException).code; |
| 151 | if (code !== 'ENOTEMPTY' && code !== 'EBUSY' && code !== 'EPERM') { |
| 152 | throw error; |
| 153 | } |
| 154 | await delay(10); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | await rm(dir, { recursive: true, force: true }); |
| 159 | } |
no test coverage detected