Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt Pandoc action to new macOS installer #716

Merged
merged 2 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion setup-pandoc/lib/setup-pandoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
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