mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 05:14:06 -06:00
Refactor folder removal in build.ts
This commit is contained in:
parent
da1e99df3c
commit
f204443095
@ -3,7 +3,7 @@ sourceMapSupport.install(options)
|
|||||||
import path from "path"
|
import path from "path"
|
||||||
import { PerfTimer } from "./util/perf"
|
import { PerfTimer } from "./util/perf"
|
||||||
import { rm } from "fs/promises"
|
import { rm } from "fs/promises"
|
||||||
import { globby, GlobbyFilterFunction, isGitIgnored } from "globby"
|
import { GlobbyFilterFunction, isGitIgnored } from "globby"
|
||||||
import { styleText } from "util"
|
import { styleText } from "util"
|
||||||
import { parseMarkdown } from "./processors/parse"
|
import { parseMarkdown } from "./processors/parse"
|
||||||
import { filterContent } from "./processors/filter"
|
import { filterContent } from "./processors/filter"
|
||||||
@ -67,7 +67,8 @@ async function buildQuartz(argv: Argv, mut: Mutex, clientRefresh: () => void) {
|
|||||||
|
|
||||||
const release = await mut.acquire()
|
const release = await mut.acquire()
|
||||||
perf.addEvent("clean")
|
perf.addEvent("clean")
|
||||||
for (const rmPath of await globby(path.join(output, "*"))) await rm(rmPath, { recursive: true })
|
|
||||||
|
await rm(output, { recursive: true, force: true })
|
||||||
console.log(`Cleaned output directory \`${output}\` in ${perf.timeSince("clean")}`)
|
console.log(`Cleaned output directory \`${output}\` in ${perf.timeSince("clean")}`)
|
||||||
|
|
||||||
perf.addEvent("glob")
|
perf.addEvent("glob")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user