mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 21:16:21 +00:00
format
This commit is contained in:
parent
d7842e0ce7
commit
558a509164
2 changed files with 9 additions and 5 deletions
|
@ -78,7 +78,7 @@ 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 = toPosixPath(fp)
|
fp = toPosixPath(fp)
|
||||||
if (!ignored(fp)) {
|
if (!ignored(fp)) {
|
||||||
const filePath = joinSegments(argv.directory, fp) as FilePath
|
const filePath = joinSegments(argv.directory, fp) as FilePath
|
||||||
if (action === "add" || action === "change") {
|
if (action === "add" || action === "change") {
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
import path from "path";
|
import path from "path"
|
||||||
import { FilePath } from "./path";
|
import { FilePath } from "./path"
|
||||||
import { globby } from "globby";
|
import { globby } from "globby"
|
||||||
|
|
||||||
export function toPosixPath(fp: string): string {
|
export function toPosixPath(fp: string): string {
|
||||||
return fp.split(path.sep).join("/")
|
return fp.split(path.sep).join("/")
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function glob(pattern: string, cwd: string, ignorePatterns: string[]): Promise<FilePath[]> {
|
export async function glob(
|
||||||
|
pattern: string,
|
||||||
|
cwd: string,
|
||||||
|
ignorePatterns: string[],
|
||||||
|
): Promise<FilePath[]> {
|
||||||
const fps = (
|
const fps = (
|
||||||
await globby(pattern, {
|
await globby(pattern, {
|
||||||
cwd,
|
cwd,
|
||||||
|
|
Loading…
Reference in a new issue