diff --git a/services/clsi/app/js/QuartoRunner.js b/services/clsi/app/js/QuartoRunner.js index f54048f0cd..1a7b60bebe 100644 --- a/services/clsi/app/js/QuartoRunner.js +++ b/services/clsi/app/js/QuartoRunner.js @@ -59,12 +59,13 @@ function _buildQuartoCommand(mainFile) { // expected by the rest of the pipeline. const inputPath = `$COMPILE_DIR/${mainFile}` const baseName = mainFile.replace(/\.[^/.]+$/, '') // strip extension - const pdfOut = `$COMPILE_DIR/${baseName}.pdf` - const htmlOut = `$COMPILE_DIR/${baseName}.html` + // LocalCommandRunner.replace() only replaces the FIRST $COMPILE_DIR + // occurrence in the shell string, so the mv commands use relative paths + // instead — the shell CWD is already set to the compile directory. const cmd = `quarto render ${inputPath} --embed-resources 2>&1 && ` + - `(mv ${pdfOut} $COMPILE_DIR/output.pdf 2>/dev/null || ` + - `mv ${htmlOut} $COMPILE_DIR/output.html 2>/dev/null)` + `(mv ${baseName}.pdf output.pdf 2>/dev/null || ` + + `mv ${baseName}.html output.html 2>/dev/null)` return ['/bin/sh', '-c', cmd] }