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

View File

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