@@ -42,7 +42,7 @@ import { dartCommand } from "../../core/dart-sass.ts";
4242import { allTools } from "../../tools/tools.ts" ;
4343import { texLiveContext , tlVersion } from "../render/latexmk/texlive.ts" ;
4444import { which } from "../../core/path.ts" ;
45- import { dirname , join } from "../../deno_ral/path.ts" ;
45+ import { dirname } from "../../deno_ral/path.ts" ;
4646import { notebookContext } from "../../render/notebook/notebook-context.ts" ;
4747import { 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