Skip to content

Commit 2d4869c

Browse files
authored
Merge pull request #290 from ZIMkaRU/bugfix/fix-skipping-publishing-of-artifact-for-mac-by-electron-builder
Fix skipping publishing of artifact for mac by electron-builder
2 parents 8b6d527 + 5fce0f5 commit 2d4869c

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

electron-builder-config.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const exec = promisify(require('child_process').exec)
99

1010
let version
1111
let zippedAppImageArtifactPath
12+
let zippedMacArtifactPath
1213
const appOutDirs = new Map()
1314

1415
/* eslint-disable no-template-curly-in-string */
@@ -205,24 +206,25 @@ module.exports = {
205206
!targets.has('zip')
206207
) {
207208
targets.set('zip', {})
208-
artifactPaths.push(path.join(
209-
outDir,
210-
`BitfinexReport-${version}-x64-${targetPlatform}.zip`
211-
))
212209
}
213210

214211
for (const [targetName] of targets) {
215212
const ext = targetName === 'nsis'
216213
? 'exe'
217214
: targetName
218-
const appFilePath = artifactPaths.find((path) => (
215+
const foundAppFilePath = artifactPaths.find((path) => (
219216
new RegExp(`${targetPlatform}.*${ext}$`, 'i').test(path)
220217
))
218+
const appFilePath = foundAppFilePath ?? path.join(
219+
outDir,
220+
`BitfinexReport-${version}-x64-${targetPlatform}.${ext}`
221+
)
221222

222223
if (
223224
targetPlatform === 'mac' &&
224225
targetName === 'zip'
225226
) {
227+
zippedMacArtifactPath = appFilePath
226228
macBlockmapFilePaths.push(
227229
`${appFilePath}.blockmap`,
228230
path.join(outDir, `${channel}-mac.yml`)
@@ -299,7 +301,7 @@ module.exports = {
299301
}
300302

301303
const macFiles = macBlockmapFilePaths.length > 0
302-
? [...artifactPaths, ...macBlockmapFilePaths]
304+
? [zippedMacArtifactPath, ...macBlockmapFilePaths]
303305
: []
304306
const linuxFiles = zippedAppImageArtifactPath
305307
? [zippedAppImageArtifactPath]

0 commit comments

Comments
 (0)