Skip to content

Commit 28703d2

Browse files
committed
Guard .exe extraction to Windows and improve error diagnostics
Only attempt self-extracting .exe on Windows in unzip(). Include candidate filenames in TinyTeX download error for easier debugging when naming drift occurs.
1 parent 63abd37 commit 28703d2

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/core/zip.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { safeWindowsExec } from "./windows.ts";
1212
export function unzip(file: string, dir?: string) {
1313
if (!dir) dir = dirname(file);
1414

15-
if (file.endsWith(".exe")) {
15+
if (isWindows && file.endsWith(".exe")) {
1616
// Self-extracting 7z archive (e.g., TinyTeX-windows.exe)
1717
return safeWindowsExec(
1818
file,

src/tools/impl/tinytex.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ async function preparePackage(
160160
await context.download(`TinyTex ${version}`, result.url, filePath);
161161
return { filePath, version };
162162
} else {
163-
context.error("Couldn't determine what URL to use to download");
163+
context.error(
164+
`Couldn't determine what URL to use to download TinyTeX. ` +
165+
`Tried: ${candidates.join(", ")}`,
166+
);
164167
return Promise.reject();
165168
}
166169
}

0 commit comments

Comments
 (0)