Skip to content

Commit

Permalink
Merge pull request #290 from ZIMkaRU/bugfix/fix-skipping-publishing-o…
Browse files Browse the repository at this point in the history
…f-artifact-for-mac-by-electron-builder

Fix skipping publishing of artifact for mac by electron-builder
  • Loading branch information
ezewer authored Jan 8, 2024
2 parents 8b6d527 + 5fce0f5 commit 2d4869c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions electron-builder-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const exec = promisify(require('child_process').exec)

let version
let zippedAppImageArtifactPath
let zippedMacArtifactPath
const appOutDirs = new Map()

/* eslint-disable no-template-curly-in-string */
Expand Down Expand Up @@ -205,24 +206,25 @@ module.exports = {
!targets.has('zip')
) {
targets.set('zip', {})
artifactPaths.push(path.join(
outDir,
`BitfinexReport-${version}-x64-${targetPlatform}.zip`
))
}

for (const [targetName] of targets) {
const ext = targetName === 'nsis'
? 'exe'
: targetName
const appFilePath = artifactPaths.find((path) => (
const foundAppFilePath = artifactPaths.find((path) => (
new RegExp(`${targetPlatform}.*${ext}$`, 'i').test(path)
))
const appFilePath = foundAppFilePath ?? path.join(
outDir,
`BitfinexReport-${version}-x64-${targetPlatform}.${ext}`
)

if (
targetPlatform === 'mac' &&
targetName === 'zip'
) {
zippedMacArtifactPath = appFilePath
macBlockmapFilePaths.push(
`${appFilePath}.blockmap`,
path.join(outDir, `${channel}-mac.yml`)
Expand Down Expand Up @@ -299,7 +301,7 @@ module.exports = {
}

const macFiles = macBlockmapFilePaths.length > 0
? [...artifactPaths, ...macBlockmapFilePaths]
? [zippedMacArtifactPath, ...macBlockmapFilePaths]
: []
const linuxFiles = zippedAppImageArtifactPath
? [zippedAppImageArtifactPath]
Expand Down

0 comments on commit 2d4869c

Please sign in to comment.