Skip to content

Commit 8d0e230

Browse files
committed
fix(dmg): Can't locate Mac/Finder/DSStore.pm in @inc
Closes #1079
1 parent 84f014c commit 8d0e230

File tree

3 files changed

+62
-12
lines changed

3 files changed

+62
-12
lines changed

packages/electron-builder/src/targets/dmg.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export class DmgTarget extends Target {
8989
windowY: window.y,
9090

9191
VERSIONER_PERL_PREFER_32_BIT: "true",
92-
PERLLIB: path.join(__dirname, "..", "..", "vendor") + (process.env.PERLLIB == null ? "" : (`:${process.env.PERLLIB}`))
9392
})
9493

9594
if (specification.icon == null) {
@@ -151,7 +150,7 @@ export class DmgTarget extends Target {
151150
await BluebirdPromise.all<any>(promises)
152151

153152
await exec("/usr/bin/perl", [dmgPropertiesFile], {
154-
cwd: this.helperDir,
153+
cwd: path.join(__dirname, "..", "..", "vendor"),
155154
env: env
156155
})
157156

test/src/helpers/setVersions.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import * as path from "path"
2+
import { readdir, readJson, writeJson } from "fs-extra-p"
3+
import BluebirdPromise from "bluebird-lst-c"
4+
5+
const printErrorAndExit = require("../../../packages/electron-builder/out/util/promise").printErrorAndExit
6+
// const exec = require("../../../packages/electron-builder/out/util/util").exec
7+
8+
async function main(): Promise<void> {
9+
const rootDir = path.join(__dirname, "../../..")
10+
const packageDir = path.join(rootDir, "packages")
11+
const packages = (await readdir(packageDir)).filter(it => !it.includes(".")).sort()
12+
// const versions = await BluebirdPromise.map(packages, it => exec("node", [path.join(rootDir, "test", "vendor", "yarn.js"), "info", "--json", it, "dist-tags"]).then((it: string) => JSON.parse(it).data))
13+
const packageData = await BluebirdPromise.map(packages, it => readJson(path.join(packageDir, it, "package.json")))
14+
const versions = packageData.map(it => it.version)
15+
16+
for (let version of versions) {
17+
if (version == "0.0.0-semantic-release") {
18+
throw new Error(`Semantic version 0.0.0-semantic-release is detected, please fix it`)
19+
}
20+
}
21+
22+
for (let i = 0; i < packages.length; i++) {
23+
const packageName = packages[i]
24+
const packageJson = packageData[i]
25+
let changed = false
26+
for (let depIndex = 0; depIndex < packages.length; depIndex++) {
27+
const depPackageName = packages[depIndex]
28+
const oldVersion = packageJson.dependencies[depPackageName]
29+
const newVersion = versions[depIndex]
30+
if (oldVersion == null) {
31+
continue
32+
}
33+
34+
if (oldVersion == newVersion) {
35+
console.log(`Skip ${depPackageName} for ${packageName} — version ${newVersion} is actual`)
36+
continue
37+
}
38+
39+
changed = true
40+
packageJson.dependencies[depPackageName] = newVersion
41+
console.log(`Set ${depPackageName} to ${newVersion} from ${oldVersion} for ${packageName}`)
42+
}
43+
44+
if (changed) {
45+
await writeJson(path.join(packageDir, packageName, "package.json"), packageJson, {spaces: 2})
46+
}
47+
}
48+
}
49+
50+
main()
51+
.catch(printErrorAndExit)

yarn.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,13 @@ babel-plugin-array-includes@^2.0.3:
332332
resolved "https://registry.yarnpkg.com/babel-plugin-array-includes/-/babel-plugin-array-includes-2.0.3.tgz#cf5452e81c7b803fb7959f1045ac88e2ec28ff76"
333333

334334
babel-plugin-istanbul@^3.0.0:
335-
version "3.0.0"
336-
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-3.0.0.tgz#da7324520ae0b8a44b6a078e72e883374a9fab76"
335+
version "3.1.1"
336+
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-3.1.1.tgz#8c3690b5ffa14d2800f1aa543e5a8078717f8768"
337337
dependencies:
338338
find-up "^1.1.2"
339-
istanbul-lib-instrument "^1.1.4"
339+
istanbul-lib-instrument "^1.4.0"
340340
object-assign "^4.1.0"
341-
test-exclude "^3.2.2"
341+
test-exclude "^3.3.0"
342342

343343
babel-plugin-jest-hoist@^18.0.0:
344344
version "18.0.0"
@@ -1748,9 +1748,9 @@ istanbul-lib-hook@^1.0.0-alpha.4:
17481748
dependencies:
17491749
append-transform "^0.3.0"
17501750

1751-
istanbul-lib-instrument@^1.1.1, istanbul-lib-instrument@^1.1.4, istanbul-lib-instrument@^1.3.0:
1752-
version "1.3.1"
1753-
resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.3.1.tgz#112c25a4f2f9bc361d13d14bbff992331b974e52"
1751+
istanbul-lib-instrument@^1.1.1, istanbul-lib-instrument@^1.3.0, istanbul-lib-instrument@^1.4.0:
1752+
version "1.4.0"
1753+
resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.4.0.tgz#33da8df669da74e532ba409e0397db0dc56be093"
17541754
dependencies:
17551755
babel-generator "^6.18.0"
17561756
babel-template "^6.16.0"
@@ -3223,7 +3223,7 @@ sync-exec@^0.6.2:
32233223
version "0.6.2"
32243224
resolved "https://registry.yarnpkg.com/sync-exec/-/sync-exec-0.6.2.tgz#717d22cc53f0ce1def5594362f3a89a2ebb91105"
32253225

3226-
test-exclude@^3.2.2:
3226+
test-exclude@^3.3.0:
32273227
version "3.3.0"
32283228
resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-3.3.0.tgz#7a17ca1239988c98367b0621456dbb7d4bc38977"
32293229
dependencies:
@@ -3453,8 +3453,8 @@ whatwg-encoding@^1.0.1:
34533453
iconv-lite "0.4.13"
34543454

34553455
whatwg-url@^4.1.0:
3456-
version "4.1.1"
3457-
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.1.1.tgz#567074923352de781e3500d64a86aa92a971b4a4"
3456+
version "4.2.0"
3457+
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.2.0.tgz#abf1a3f5ff4bc2005b3f0c2119382631789d8e44"
34583458
dependencies:
34593459
tr46 "~0.0.3"
34603460
webidl-conversions "^3.0.0"

0 commit comments

Comments
 (0)