Skip to content

Commit

Permalink
fix(dmg): Can't locate Mac/Finder/DSStore.pm in @inc
Browse files Browse the repository at this point in the history
Closes #1079
  • Loading branch information
develar committed Jan 4, 2017
1 parent 84f014c commit 8d0e230
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 12 deletions.
3 changes: 1 addition & 2 deletions packages/electron-builder/src/targets/dmg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export class DmgTarget extends Target {
windowY: window.y,

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

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

await exec("/usr/bin/perl", [dmgPropertiesFile], {
cwd: this.helperDir,
cwd: path.join(__dirname, "..", "..", "vendor"),
env: env
})

Expand Down
51 changes: 51 additions & 0 deletions test/src/helpers/setVersions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import * as path from "path"
import { readdir, readJson, writeJson } from "fs-extra-p"
import BluebirdPromise from "bluebird-lst-c"

const printErrorAndExit = require("../../../packages/electron-builder/out/util/promise").printErrorAndExit
// const exec = require("../../../packages/electron-builder/out/util/util").exec

async function main(): Promise<void> {
const rootDir = path.join(__dirname, "../../..")
const packageDir = path.join(rootDir, "packages")
const packages = (await readdir(packageDir)).filter(it => !it.includes(".")).sort()
// 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))
const packageData = await BluebirdPromise.map(packages, it => readJson(path.join(packageDir, it, "package.json")))
const versions = packageData.map(it => it.version)

for (let version of versions) {
if (version == "0.0.0-semantic-release") {
throw new Error(`Semantic version 0.0.0-semantic-release is detected, please fix it`)
}
}

for (let i = 0; i < packages.length; i++) {
const packageName = packages[i]
const packageJson = packageData[i]
let changed = false
for (let depIndex = 0; depIndex < packages.length; depIndex++) {
const depPackageName = packages[depIndex]
const oldVersion = packageJson.dependencies[depPackageName]
const newVersion = versions[depIndex]
if (oldVersion == null) {
continue
}

if (oldVersion == newVersion) {
console.log(`Skip ${depPackageName} for ${packageName} — version ${newVersion} is actual`)
continue
}

changed = true
packageJson.dependencies[depPackageName] = newVersion
console.log(`Set ${depPackageName} to ${newVersion} from ${oldVersion} for ${packageName}`)
}

if (changed) {
await writeJson(path.join(packageDir, packageName, "package.json"), packageJson, {spaces: 2})
}
}
}

main()
.catch(printErrorAndExit)
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,13 @@ babel-plugin-array-includes@^2.0.3:
resolved "https://registry.yarnpkg.com/babel-plugin-array-includes/-/babel-plugin-array-includes-2.0.3.tgz#cf5452e81c7b803fb7959f1045ac88e2ec28ff76"

babel-plugin-istanbul@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-3.0.0.tgz#da7324520ae0b8a44b6a078e72e883374a9fab76"
version "3.1.1"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-3.1.1.tgz#8c3690b5ffa14d2800f1aa543e5a8078717f8768"
dependencies:
find-up "^1.1.2"
istanbul-lib-instrument "^1.1.4"
istanbul-lib-instrument "^1.4.0"
object-assign "^4.1.0"
test-exclude "^3.2.2"
test-exclude "^3.3.0"

babel-plugin-jest-hoist@^18.0.0:
version "18.0.0"
Expand Down Expand Up @@ -1748,9 +1748,9 @@ istanbul-lib-hook@^1.0.0-alpha.4:
dependencies:
append-transform "^0.3.0"

istanbul-lib-instrument@^1.1.1, istanbul-lib-instrument@^1.1.4, istanbul-lib-instrument@^1.3.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.3.1.tgz#112c25a4f2f9bc361d13d14bbff992331b974e52"
istanbul-lib-instrument@^1.1.1, istanbul-lib-instrument@^1.3.0, istanbul-lib-instrument@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.4.0.tgz#33da8df669da74e532ba409e0397db0dc56be093"
dependencies:
babel-generator "^6.18.0"
babel-template "^6.16.0"
Expand Down Expand Up @@ -3223,7 +3223,7 @@ sync-exec@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/sync-exec/-/sync-exec-0.6.2.tgz#717d22cc53f0ce1def5594362f3a89a2ebb91105"

test-exclude@^3.2.2:
test-exclude@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-3.3.0.tgz#7a17ca1239988c98367b0621456dbb7d4bc38977"
dependencies:
Expand Down Expand Up @@ -3453,8 +3453,8 @@ whatwg-encoding@^1.0.1:
iconv-lite "0.4.13"

whatwg-url@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.1.1.tgz#567074923352de781e3500d64a86aa92a971b4a4"
version "4.2.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.2.0.tgz#abf1a3f5ff4bc2005b3f0c2119382631789d8e44"
dependencies:
tr46 "~0.0.3"
webidl-conversions "^3.0.0"
Expand Down

0 comments on commit 8d0e230

Please sign in to comment.