mirror of
https://github.com/electron/node-gyp.git
synced 2025-08-15 12:58:19 +02:00
test: Require with empty cache
This commit is contained in:
parent
e25ec9e836
commit
3f80e318cd
5 changed files with 8 additions and 8 deletions
|
@ -9,13 +9,13 @@ promises.rm = promises.rm || async function (...args) {
|
|||
const options = args[1] || {}
|
||||
|
||||
try {
|
||||
const stat = await fs.stat(pathToRemove, { throwIfNoEntry: false })
|
||||
const stat = await promises.stat(pathToRemove, { throwIfNoEntry: false })
|
||||
const isDirectory = stat.isDirectory()
|
||||
|
||||
if (isDirectory) {
|
||||
await fs.rmdir(pathToRemove, options)
|
||||
await promises.rmdir(pathToRemove, options)
|
||||
} else {
|
||||
await fs.unlink(pathToRemove)
|
||||
await promises.unlink(pathToRemove)
|
||||
}
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT' && options.force) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue