mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +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;
|
|
}
|
|
}
|
|
}
|