Skip to content

Commit ac44fcd

Browse files
Daniel Pereiradevelar
authored andcommitted
fix: macOS failing when there is no old icon (#1658)
1 parent 54ac796 commit ac44fcd

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

packages/electron-builder/src/packager/mac.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import BluebirdPromise from "bluebird-lst"
33
import { asArray, getPlatformIconFileName, use } from "electron-builder-util"
44
import { copyFile, copyOrLinkFile, unlinkIfExists } from "electron-builder-util/out/fs"
55
import { warn } from "electron-builder-util/out/log"
6-
import { readFile, rename, unlink, utimes, writeFile } from "fs-extra-p"
6+
import { readFile, rename, utimes, writeFile } from "fs-extra-p"
77
import * as path from "path"
88
import { build as buildPlist, parse as parsePlist } from "plist"
99
import { normalizeExt, PlatformPackager } from "../platformPackager"
@@ -151,7 +151,7 @@ export async function createApp(packager: PlatformPackager<any>, appOutDir: stri
151151
]
152152

153153
if (icon != null) {
154-
promises.push(unlink(path.join(resourcesPath, oldIcon)))
154+
promises.push(unlinkIfExists(path.join(resourcesPath, oldIcon)))
155155
promises.push(copyFile(icon, path.join(resourcesPath, appPlist.CFBundleIconFile)))
156156
}
157157

yarn.lock

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,9 +1231,9 @@ fb-watchman@^2.0.0:
12311231
dependencies:
12321232
bser "^2.0.0"
12331233

1234-
fcopy-pre-bundled@^0.1.2:
1235-
version "0.1.2"
1236-
resolved "https://registry.yarnpkg.com/fcopy-pre-bundled/-/fcopy-pre-bundled-0.1.2.tgz#656baeb0d0c450cafa9c902664d440ceb99bcde1"
1234+
fcopy-pre-bundled@0.2.0:
1235+
version "0.2.0"
1236+
resolved "https://registry.yarnpkg.com/fcopy-pre-bundled/-/fcopy-pre-bundled-0.2.0.tgz#846195cb53cf0a987ca9ebee4d70f81277c10f8a"
12371237

12381238
feature-detect-es6@^1.3.1:
12391239
version "1.3.1"
@@ -2948,14 +2948,10 @@ sanitize-filename@^1.6.1:
29482948
dependencies:
29492949
truncate-utf8-bytes "^1.0.0"
29502950

2951-
sax@1.2.1:
2951+
sax@1.2.1, sax@>=0.6.0, sax@^1.2.1:
29522952
version "1.2.1"
29532953
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a"
29542954

2955-
sax@>=0.6.0, sax@^1.2.1:
2956-
version "1.2.2"
2957-
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.2.tgz#fd8631a23bc7826bef5d871bdb87378c95647828"
2958-
29592955
semver-diff@^2.0.0:
29602956
version "2.1.0"
29612957
resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36"

0 commit comments

Comments
 (0)