Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/src/core/api/system.ts
6458 views
1
// src/core/api/system.ts
2
3
import { globalRegistry } from "./registry.ts";
4
import type { SystemNamespace } from "./types.ts";
5
6
// Import implementations
7
import { isInteractiveSession } from "../platform.ts";
8
import { runningInCI } from "../ci-info.ts";
9
import { execProcess } from "../process.ts";
10
import { runExternalPreviewServer } from "../../preview/preview-server.ts";
11
import { onCleanup } from "../cleanup.ts";
12
import { globalTempContext } from "../temp.ts";
13
import { checkRender } from "../../command/check/check-render.ts";
14
import { pandocBinaryPath } from "../resources.ts";
15
16
// Register system namespace
17
globalRegistry.register("system", (): SystemNamespace => {
18
return {
19
isInteractiveSession,
20
runningInCI,
21
execProcess,
22
runExternalPreviewServer,
23
onCleanup,
24
tempContext: globalTempContext,
25
checkRender,
26
pandoc: (args: string[], stdin?: string) => {
27
return execProcess(
28
{
29
cmd: pandocBinaryPath(),
30
args,
31
stdout: "piped",
32
stderr: "piped",
33
},
34
stdin,
35
);
36
},
37
};
38
});
39
40