Skip to content

Commit

Permalink
Adapt Pandoc action to new macOS installer
Browse files Browse the repository at this point in the history
Closes #715
  • Loading branch information
IndrajeetPatil committed Mar 29, 2023
1 parent 4376fa2 commit 91e3ef2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion setup-pandoc/lib/setup-pandoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ 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);
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, fileName);
let downloadPath;
try {
Expand Down
5 changes: 4 additions & 1 deletion setup-pandoc/src/setup-pandoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export function getPandoc(version: string): Promise<void> {
}

async function installPandocMac(version: string): Promise<void> {
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,
Expand Down

0 comments on commit 91e3ef2

Please sign in to comment.