3DS-RPC/server/templates/scripts/clean.js
Spotlight 247655fe57
Migrate frontend to modern stack
This (hopefully) makes changes to the frontend somewhat easier.
2024-12-10 02:15:28 -06:00

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