@@ -35,7 +35,7 @@ export interface QuartoContext {
35
35
36
36
/**
37
37
* Initialize a Quarto context.
38
- *
38
+ *
39
39
* @param quartoPath A path to a user-specified Quarto executable. If
40
40
* supplied, this will be used in preference to other methods of detecting
41
41
* Quarto.
@@ -44,7 +44,7 @@ export interface QuartoContext {
44
44
* @param additionalSearchPaths Additional paths to search for Quarto. These will only be used if
45
45
* Quarto is not found in the default locations or the system path.
46
46
* @param showWarning A function to call to show a warning message.
47
- *
47
+ *
48
48
* @returns A Quarto context.
49
49
*/
50
50
export function initQuartoContext (
@@ -80,13 +80,13 @@ export function initQuartoContext(
80
80
// use cmd suffix for older versions of quarto on windows
81
81
const windows = os . platform ( ) == "win32" ;
82
82
const useCmd = windows && semver . lte ( quartoInstall . version , "1.1.162" ) ;
83
- let pandocPath = path . join ( quartoInstall ! . binPath , "tools" , "pandoc" ) ;
83
+ let pandocPath = process . env [ "QUARTO_PANDOC" ] || path . join ( quartoInstall ! . binPath , "tools" , "pandoc" ) ;
84
84
// more recent versions of quarto use architecture-specific tools dir,
85
85
// if the pandocPath is not found then look in the requisite dir for this arch
86
86
if ( ! windows && ! fs . existsSync ( pandocPath ) ) {
87
87
pandocPath = path . join (
88
- path . dirname ( pandocPath ) ,
89
- isArm_64 ( ) ? "aarch64" : "x86_64" ,
88
+ path . dirname ( pandocPath ) ,
89
+ isArm_64 ( ) ? "aarch64" : "x86_64" ,
90
90
path . basename ( pandocPath )
91
91
) ;
92
92
}
@@ -114,7 +114,7 @@ export function initQuartoContext(
114
114
}
115
115
}
116
116
117
- export function quartoContextUnavailable ( ) : QuartoContext {
117
+ export function quartoContextUnavailable ( ) : QuartoContext {
118
118
return {
119
119
available : false ,
120
120
version : "" ,
@@ -179,8 +179,8 @@ function detectUserSpecifiedQuarto(
179
179
if ( ! fs . statSync ( quartoPath ) . isFile ( ) ) {
180
180
showWarning (
181
181
"Specified quarto executable is a directory not a file: '" +
182
- quartoPath +
183
- "'"
182
+ quartoPath +
183
+ "'"
184
184
) ;
185
185
return undefined ;
186
186
}
@@ -191,9 +191,9 @@ function detectUserSpecifiedQuarto(
191
191
192
192
/**
193
193
* Scan for Quarto in known locations.
194
- *
194
+ *
195
195
* @param additionalSearchPaths Additional paths to search for Quarto (optional)
196
- *
196
+ *
197
197
* @returns A Quarto installation if found, otherwise undefined
198
198
*/
199
199
function scanForQuarto ( additionalSearchPaths ?: string [ ] ) : QuartoInstallation | undefined {
0 commit comments