1
0
Fork 0
pull/1344/head
Cory Miller 2023-02-22 15:48:52 +00:00
parent d589c08bf4
commit eed631025c
2 changed files with 6 additions and 4 deletions

View File

@ -344,12 +344,15 @@ describe('rmRF', () => {
await assertExists(filePath)
const fd = await fs.open(filePath, 'r')
await io.rmRF(testPath)
// can't remove folder with locked file on windows
if (ioUtil.IS_WINDOWS) {
try {
// additionally, can't stat an open file on Windows without getting EPERM
await ioUtil.access(filePath)
await io.rmRF(testPath)
} catch (err) {
expect(err.code).toBe('EPERM')
}
} else {
await assertNotExists(testPath)
}

View File

@ -136,7 +136,6 @@ export async function rmRF(inputPath: string): Promise<void> {
} catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
console.log(err)
if (err.code !== 'ENOENT') throw err
}