Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/package/src/common/create-deno-config.ts
6450 views
1
import { expandGlobSync } from "../../../src/deno_ral/fs.ts";
2
3
const json = JSON.parse(
4
Deno.readTextFileSync("package/src/common/deno-meta.json"),
5
//deno-lint-ignore no-explicit-any
6
) as any;
7
const meta = json.meta;
8
9
delete json.meta;
10
11
let excludes: string[] = [];
12
for (const file of meta.excludeGlobs) {
13
const f: string = file;
14
if (f.includes("*")) {
15
for (const { path } of expandGlobSync(f)) {
16
excludes.push(path);
17
}
18
} else {
19
excludes.push(f);
20
}
21
}
22
23
// drop the current working directory from the paths
24
excludes = excludes.map((e) => e.replace(Deno.cwd() + "/", ""));
25
26
json.lint.exclude = excludes;
27
json.fmt.exclude = excludes;
28
29
console.log("// auto-generated by package/src/common/create-deno-config.ts");
30
console.log("// see dev-docs/update-deno_jsonc.md");
31
console.log(JSON.stringify(json, null, 2));
32
33