mirror of
https://github.com/MCMi460/3DS-RPC.git
synced 2025-06-18 21:45:37 -04:00
13 lines
306 B
JavaScript
13 lines
306 B
JavaScript
import fs from "fs/promises";
|
|
|
|
const destPath = new URL("../dist", import.meta.url);
|
|
|
|
// Only delete if the directory exists.
|
|
let destExists = fs.access(destPath, fs.constants.F_OK)
|
|
.then(() => true)
|
|
.catch(() => false);
|
|
|
|
if (destExists == true) {
|
|
await fs.rm(destPath, { recursive: true });
|
|
}
|