diff --git a/setup-pandoc/lib/setup-pandoc.js b/setup-pandoc/lib/setup-pandoc.js index a079e8ca..d73a0082 100644 --- a/setup-pandoc/lib/setup-pandoc.js +++ b/setup-pandoc/lib/setup-pandoc.js @@ -87,7 +87,9 @@ exports.getPandoc = getPandoc; function installPandocMac(version) { var _a; return __awaiter(this, void 0, void 0, function* () { - const fileName = util.format("pandoc-%s-macOS.pkg", version); + // Since 3.1.2, Pandoc uses cabal instead of stack to build the macOS binary. + const is_new_macos_installer = (0, compare_versions_1.compare)(version, "3.1.2", ">=") ? true : false; + const fileName = is_new_macos_installer ? util.format("pandoc-%s-x86_64-macOS.pkg", version) : util.format("pandoc-%s-macOS.pkg", version); const downloadUrl = util.format("https://github.com/jgm/pandoc/releases/download/%s/%s", version, fileName); let downloadPath; try { diff --git a/setup-pandoc/src/setup-pandoc.ts b/setup-pandoc/src/setup-pandoc.ts index 2ea4dadb..a00099c8 100644 --- a/setup-pandoc/src/setup-pandoc.ts +++ b/setup-pandoc/src/setup-pandoc.ts @@ -48,7 +48,10 @@ export function getPandoc(version: string): Promise { } async function installPandocMac(version: string): Promise { - const fileName = util.format("pandoc-%s-macOS.pkg", version); + // Since 3.1.2, Pandoc uses cabal instead of stack to build the macOS binary. + const is_new_macos_installer = compare(version, "3.1.2", ">=") ? true : false; + const fileName = is_new_macos_installer ? util.format("pandoc-%s-x86_64-macOS.pkg", version) : util.format("pandoc-%s-macOS.pkg", version); + const downloadUrl = util.format( "https://github.com/jgm/pandoc/releases/download/%s/%s", version,