mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
13 lines
269 B
JavaScript
13 lines
269 B
JavaScript
|
import fsRoot from "fs";
|
||
|
const fs = fsRoot.promises;
|
||
|
|
||
|
export async function removeDirIfExists(targetDir) {
|
||
|
try {
|
||
|
await fs.rmdir(targetDir, {recursive: true});
|
||
|
} catch (err) {
|
||
|
if (err.code !== "ENOENT") {
|
||
|
throw err;
|
||
|
}
|
||
|
}
|
||
|
}
|