mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-26 05:19:01 +00:00
windows patches
This commit is contained in:
parent
c8c108c7f7
commit
9a0f20012a
1 changed files with 6 additions and 5 deletions
|
@ -10,7 +10,7 @@ import { parseMarkdown } from "./processors/parse"
|
||||||
import { filterContent } from "./processors/filter"
|
import { filterContent } from "./processors/filter"
|
||||||
import { emitContent } from "./processors/emit"
|
import { emitContent } from "./processors/emit"
|
||||||
import cfg from "../quartz.config"
|
import cfg from "../quartz.config"
|
||||||
import { FilePath, slugifyFilePath } from "./path"
|
import { FilePath, joinSegments, slugifyFilePath } from "./path"
|
||||||
import chokidar from "chokidar"
|
import chokidar from "chokidar"
|
||||||
import { ProcessedContent } from "./plugins/vfile"
|
import { ProcessedContent } from "./plugins/vfile"
|
||||||
import WebSocket, { WebSocketServer } from "ws"
|
import WebSocket, { WebSocketServer } from "ws"
|
||||||
|
@ -42,16 +42,16 @@ async function buildQuartz(argv: Argv, version: string) {
|
||||||
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")
|
||||||
const fps = await globby("**/*.md", {
|
const fps = (await globby("**/*.md", {
|
||||||
cwd: argv.directory,
|
cwd: argv.directory,
|
||||||
ignore: cfg.configuration.ignorePatterns,
|
ignore: cfg.configuration.ignorePatterns,
|
||||||
gitignore: true,
|
gitignore: true,
|
||||||
})
|
})).map(fp => fp.split(path.sep).join(path.posix.sep))
|
||||||
console.log(
|
console.log(
|
||||||
`Found ${fps.length} input files from \`${argv.directory}\` in ${perf.timeSince("glob")}`,
|
`Found ${fps.length} input files from \`${argv.directory}\` in ${perf.timeSince("glob")}`,
|
||||||
)
|
)
|
||||||
|
|
||||||
const filePaths = fps.map((fp) => `${argv.directory}${path.sep}${fp}` as FilePath)
|
const filePaths = fps.map((fp) => joinSegments(argv.directory, fp) as FilePath)
|
||||||
ctx.allSlugs = fps.map((fp) => slugifyFilePath(fp as FilePath))
|
ctx.allSlugs = fps.map((fp) => slugifyFilePath(fp as FilePath))
|
||||||
|
|
||||||
const parsedFiles = await parseMarkdown(ctx, filePaths)
|
const parsedFiles = await parseMarkdown(ctx, filePaths)
|
||||||
|
@ -81,8 +81,9 @@ async function startServing(ctx: BuildCtx, initialContent: ProcessedContent[]) {
|
||||||
let toRebuild: Set<FilePath> = new Set()
|
let toRebuild: Set<FilePath> = new Set()
|
||||||
let toRemove: Set<FilePath> = new Set()
|
let toRemove: Set<FilePath> = new Set()
|
||||||
async function rebuild(fp: string, action: "add" | "change" | "delete") {
|
async function rebuild(fp: string, action: "add" | "change" | "delete") {
|
||||||
|
fp = fp.split(path.sep).join(path.posix.sep)
|
||||||
if (!ignored(fp)) {
|
if (!ignored(fp)) {
|
||||||
const filePath = `${argv.directory}${path.sep}${fp}` as FilePath
|
const filePath = joinSegments(argv.directory, fp) as FilePath
|
||||||
if (action === "add" || action === "change") {
|
if (action === "add" || action === "change") {
|
||||||
toRebuild.add(filePath)
|
toRebuild.add(filePath)
|
||||||
} else if (action === "delete") {
|
} else if (action === "delete") {
|
||||||
|
|
Loading…
Reference in a new issue