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"],
|
||||
cwd: "docs",
|
||||
}).output();
|
||||
console.log("Done!");
|
||||
}
|
||||
|
||||
async function watchAndBuildDocs() {
|
||||
async function watchAndBuildDocs(addr: Addr) {
|
||||
let changeOccurred = true;
|
||||
let running = false;
|
||||
setInterval(async () => {
|
||||
@ -27,7 +26,9 @@ async function watchAndBuildDocs() {
|
||||
return;
|
||||
}
|
||||
running = true;
|
||||
console.clear();
|
||||
await buildDocs();
|
||||
alertListening(addr);
|
||||
changeOccurred = false;
|
||||
running = false;
|
||||
}, 250);
|
||||
@ -51,9 +52,10 @@ function serveDist(addr: Addr) {
|
||||
}
|
||||
|
||||
if (import.meta.main) {
|
||||
watchAndBuildDocs();
|
||||
serveDist({
|
||||
const addr = {
|
||||
hostname: "0.0.0.0",
|
||||
port: 8180,
|
||||
});
|
||||
};
|
||||
watchAndBuildDocs(addr);
|
||||
serveDist(addr);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user