fix: clear command
This commit is contained in:
parent
8f4f1f105b
commit
2c8ed66bab
@ -1,5 +1,6 @@
|
|||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import paths from "node:path";
|
import paths from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
|
||||||
export default function clear() {
|
export default function clear() {
|
||||||
deletePathForce("./site")
|
deletePathForce("./site")
|
||||||
@ -13,3 +14,5 @@ function deletePathForce(path) {
|
|||||||
.forEach(deletePathForce);
|
.forEach(deletePathForce);
|
||||||
fs.rmdirSync(path);
|
fs.rmdirSync(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.argv[1] === fileURLToPath(import.meta.url)) clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user