dev.ts: clear console
This commit is contained in:
parent
89756c2a5e
commit
275aaed941
12
dev.ts
12
dev.ts
@ -16,10 +16,9 @@ async function buildDocs() {
|
|||||||
args: ["task", "build"],
|
args: ["task", "build"],
|
||||||
cwd: "docs",
|
cwd: "docs",
|
||||||
}).output();
|
}).output();
|
||||||
console.log("Done!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function watchAndBuildDocs() {
|
async function watchAndBuildDocs(addr: Addr) {
|
||||||
let changeOccurred = true;
|
let changeOccurred = true;
|
||||||
let running = false;
|
let running = false;
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
@ -27,7 +26,9 @@ async function watchAndBuildDocs() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
running = true;
|
running = true;
|
||||||
|
console.clear();
|
||||||
await buildDocs();
|
await buildDocs();
|
||||||
|
alertListening(addr);
|
||||||
changeOccurred = false;
|
changeOccurred = false;
|
||||||
running = false;
|
running = false;
|
||||||
}, 250);
|
}, 250);
|
||||||
@ -51,9 +52,10 @@ function serveDist(addr: Addr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (import.meta.main) {
|
if (import.meta.main) {
|
||||||
watchAndBuildDocs();
|
const addr = {
|
||||||
serveDist({
|
|
||||||
hostname: "0.0.0.0",
|
hostname: "0.0.0.0",
|
||||||
port: 8180,
|
port: 8180,
|
||||||
});
|
};
|
||||||
|
watchAndBuildDocs(addr);
|
||||||
|
serveDist(addr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user