Skip to content

Commit 42b8eeb

Browse files
committed
Revert "QUARTO_ROOT can be unset in some of our runs"
This reverts commit cf14684. Just to check if QUARTO_ROOT was unset or just this was a type check issue
1 parent a2d56ae commit 42b8eeb

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/command/check/check.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import { dartCommand } from "../../core/dart-sass.ts";
4242
import { allTools } from "../../tools/tools.ts";
4343
import { texLiveContext, tlVersion } from "../render/latexmk/texlive.ts";
4444
import { which } from "../../core/path.ts";
45-
import { dirname, join } from "../../deno_ral/path.ts";
45+
import { dirname } from "../../deno_ral/path.ts";
4646
import { notebookContext } from "../../render/notebook/notebook-context.ts";
4747
import { typstBinaryPath } from "../../core/typst.ts";
4848

@@ -146,19 +146,15 @@ async function checkInstall(services: RenderServices) {
146146
// if they're running a dev version, we assume git is installed
147147
// and QUARTO_ROOT is set to the root of the quarto-cli repo
148148
// print the output of git rev-parse HEAD
149-
const gitHead = await execProcess({
150-
cmd: [
151-
"git",
152-
"-C",
153-
join(quartoConfig.sharePath(), "../.."),
154-
"rev-parse",
155-
"HEAD",
156-
],
157-
stdout: "piped",
158-
stderr: "piped", // to not show error if not in a git repo
159-
});
160-
if (gitHead.success && gitHead.stdout) {
161-
info(` commit: ${gitHead.stdout.trim()}`);
149+
if (Deno.env.get("QUARTO_ROOT") !== undefined) {
150+
const gitHead = await execProcess({
151+
cmd: ["git", "-C", Deno.env.get("QUARTO_ROOT"), "rev-parse", "HEAD"],
152+
stdout: "piped",
153+
stderr: "piped", // to not show error if not in a git repo
154+
});
155+
if (gitHead.success && gitHead.stdout) {
156+
info(` commit: ${gitHead.stdout.trim()}`);
157+
}
162158
}
163159
}
164160
info(` Path: ${quartoConfig.binPath()}`);

0 commit comments

Comments
 (0)