hydrogen-web/scripts/common.mjs
2020-08-27 19:51:04 +02:00

12 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;
}
}
}