mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 03:25: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;
|
|
}
|
|
}
|
|
}
|