Skip to content

Commit 743221c

Browse files
committed
🐛 check for dependencies
1 parent 5a36a0e commit 743221c

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

src/vuegen/quarto_reportview.py

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,28 @@ def run_report(self, output_dir: str = BASE_DIR) -> None:
170170
self.report.logger.info(
171171
f"Running '{self.report.title}' '{self.report_type}' report with {args!r}"
172172
)
173-
subprocess.run(
174-
[
175-
self.quarto_path,
176-
"render",
177-
os.path.join(output_dir, f"{self.BASE_DIR}.qmd"),
178-
],
179-
check=True,
180-
)
173+
if self.report_type in [
174+
r.ReportType.PDF,
175+
r.ReportType.DOCX,
176+
r.ReportType.ODT,
177+
]:
178+
subprocess.run(
179+
[self.quarto_path, "install", "tinytex"],
180+
check=True,
181+
)
182+
subprocess.run(
183+
[self.quarto_path, "install", "chromium"],
184+
check=True,
185+
)
181186
try:
187+
subprocess.run(
188+
[
189+
self.quarto_path,
190+
"render",
191+
os.path.join(output_dir, f"{self.BASE_DIR}.qmd"),
192+
],
193+
check=True,
194+
)
182195
if self.report_type == r.ReportType.JUPYTER:
183196
args = [self.quarto_path, "convert", file_path_to_qmd]
184197
subprocess.run(

0 commit comments

Comments
 (0)