Skip to content

Commit

Permalink
Preserve the proper environment var name when making architecture path
Browse files Browse the repository at this point in the history
This should address the issue #7344  raised in NixOS/nixpkgs#263108

Thanks to @b-rodrigues and @minijackson for their diligence in identifying the issue.
  • Loading branch information
dragonstyle committed Oct 29, 2023
1 parent e12eba1 commit 9424133
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/core/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,17 @@ export function formatResourcePath(format: string, resource: string) {
return join(resourcePath("formats"), format, resource);
}

export function architectureToolsPath(path: string) {
export function architectureToolsPath(binary: string) {
const arch = Deno.build.arch;
const archDir = join(arch, path);
return toolsPath(archDir);
const archBinaryPath = join(arch, binary);
return toolsPath(binary, archBinaryPath);
}

export function toolsPath(binary: string): string {
export function toolsPath(binary: string, defaultPath?: string): string {
console.log({
binary,
defaultPath,
});
const displayWarning = () => {
warnOnce(
`Specified ${binaryEnvKey} does not exist, using built in ${binary}`,
Expand Down Expand Up @@ -72,8 +76,7 @@ export function toolsPath(binary: string): string {
}
}
}

return join(quartoConfig.toolsPath(), binary);
return join(quartoConfig.toolsPath(), defaultPath || binary);
}

export function pandocBinaryPath(): string {
Expand Down

0 comments on commit 9424133

Please sign in to comment.