Skip to content

Commit 203928b

Browse files
authored
fix: download the browser in advance (#16)
1 parent 35abbe0 commit 203928b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cli.ts

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
import { mdToPdf } from "./md-to-pdf.ts";
2525
import { getFilename } from "./utils/filename.ts";
2626
import type { MdToPdfOptions } from "./types.ts";
27+
import { getBinary } from "@astral/astral";
2728

2829
function printHelp(): void {
2930
const help = `md2pdf: ${
@@ -89,6 +90,10 @@ if (args._) {
8990
}
9091
}
9192

93+
// Prepare browser
94+
// If the browser is not installed, download it
95+
await getBinary("chrome");
96+
9297
if (paths.length < 1) {
9398
const exitCode = args._.length ? 1 : 0;
9499
if (exitCode) {

0 commit comments

Comments
 (0)