Skip to content

Commit

Permalink
Fix an error in the Pandoc code
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanlesage committed Mar 22, 2021
1 parent 3d260fe commit e19232f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
8 changes: 6 additions & 2 deletions forge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ module.exports = {
await downloadPandoc('win32', 'x64')
}

forgeConfig.packagerConfig.extraResource.push('./resources/pandoc-win32-x64.exe')
await fs.copyFile(path.join(__dirname, './resources/pandoc-win32-x64.exe'), path.join(__dirname, './resources/pandoc.exe'))

forgeConfig.packagerConfig.extraResource.push('./resources/pandoc.exe')
} else if (supportsPandoc && (isMacOS || isLinux)) {
// Download Pandoc either for macOS or Linux ...
const platform = (isMacOS) ? 'darwin' : 'linux'
Expand All @@ -89,7 +91,9 @@ module.exports = {
await downloadPandoc(platform, arch)
}

forgeConfig.packagerConfig.extraResource.push(`./resources/pandoc-${platform}-${arch}`)
await fs.copyFile(path.join(__dirname, `./resources/pandoc-${platform}-${arch}`), path.join(__dirname, './resources/pandoc'))

forgeConfig.packagerConfig.extraResource.push('./resources/pandoc')
} else {
// If someone is building this on an unsupported platform, drop a warning.
console.log('\nBuilding for an unsupported platform/arch-combination - not bundling Pandoc.')
Expand Down
13 changes: 1 addition & 12 deletions source/app/util/environment-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,7 @@ export default async function environmentCheck (): Promise<void> {

// We need to check if Pandoc has been bundled with this package.
// Because if it is, we can simply use that one instead.
let executable = ''
if (process.platform === 'win32') {
executable = 'pandoc-win32-x64.exe'
} else if (isLinux && is64Bit) {
executable = 'pandoc-linux-x64'
} else if (linuxARM) {
executable = 'pandoc-linux-arm'
} else if (isDarwin) {
executable = 'pandoc-darwin-x64'
}

// const executable = (process.platform === 'win32') ? 'pandoc.exe' : 'pandoc'
const executable = (process.platform === 'win32') ? 'pandoc.exe' : 'pandoc'
const pandocPath = path.join(process.resourcesPath, executable)
if (isFile(pandocPath)) {
global.log.info(`[Application] Pandoc has been bundled with this release. Path: ${pandocPath}`)
Expand Down

0 comments on commit e19232f

Please sign in to comment.