1
0
mirror of https://gitlab.com/MisterBiggs/brain-quartz.git synced 2025-09-22 21:52:42 +00:00
Files
.github
content
quartz
components
plugins
processors
static
styles
util
ctx.ts
glob.ts
log.ts
path.test.ts
path.ts
perf.ts
resources.tsx
sourcemap.ts
theme.ts
trace.ts
bootstrap-cli.mjs
bootstrap-worker.mjs
build.ts
cfg.ts
worker.ts
.gitattributes
.gitignore
.prettierignore
.prettierrc
CODE_OF_CONDUCT.md
LICENSE.txt
README.md
globals.d.ts
index.d.ts
package-lock.json
package.json
quartz.config.ts
quartz.layout.ts
tsconfig.json
brain-quartz/quartz/util/glob.ts

23 lines
462 B
TypeScript

import path from "path"
import { FilePath } from "./path"
import { globby } from "globby"
export function toPosixPath(fp: string): string {
return fp.split(path.sep).join("/")
}
export async function glob(
pattern: string,
cwd: string,
ignorePatterns: string[],
): Promise<FilePath[]> {
const fps = (
await globby(pattern, {
cwd,
ignore: ignorePatterns,
gitignore: true,
})
).map(toPosixPath)
return fps as FilePath[]
}