diff --git a/package.json b/package.json index 92a94c15e61..63e1cfcddb2 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "yargs": "^6.3.0" }, "devDependencies": { - "@develar/semantic-release": "^6.3.13", + "@develar/semantic-release": "^6.3.17", "@types/ini": "^1.3.29", "@types/js-yaml": "^3.5.28", "@types/source-map-support": "^0.2.28", diff --git a/src/targets/dmg.ts b/src/targets/dmg.ts index 3a73cbc6552..03ef1c96259 100644 --- a/src/targets/dmg.ts +++ b/src/targets/dmg.ts @@ -4,7 +4,7 @@ import { log, warn } from "../util/log" import { Target, PlatformPackager } from "../platformPackager" import { MacOptions, DmgOptions, DmgContent } from "../options/macOptions" import BluebirdPromise from "bluebird-lst-c" -import { debug, use, exec, statOrNull, isEmptyOrSpaces } from "../util/util" +import { debug, use, exec, statOrNull, isEmptyOrSpaces, spawn } from "../util/util" import { copy, unlink, outputFile, remove } from "fs-extra-p" import { executeFinally } from "../util/promise" @@ -43,14 +43,13 @@ export class DmgTarget extends Target { const volumeName = `${appInfo.productFilename} ${appInfo.version}` //noinspection SpellCheckingInspection - await exec("hdiutil", ["create", + await spawn("hdiutil", addVerboseIfNeed(["create", "-srcfolder", backgroundDir, "-srcfolder", path.join(appOutDir, `${packager.appInfo.productFilename}.app`), "-volname", volumeName, - "-anyowners", "-nospotlight", "-quiet", "-fs", "HFS+", "-fsargs", "-c c=64,a=16,e=16", + "-anyowners", "-nospotlight", "-fs", "HFS+", "-fsargs", "-c c=64,a=16,e=16", "-format", "UDRW", - tempDmg, - ]) + ]).concat(tempDmg)) const volumePath = path.join("/Volumes", volumeName) if (await statOrNull(volumePath) != null) { @@ -151,8 +150,8 @@ export class DmgTarget extends Target { const artifactPath = path.join(appOutDir, `${appInfo.productFilename}-${appInfo.version}.dmg`) //noinspection SpellCheckingInspection - await exec("hdiutil", ["convert", tempDmg, "-format", packager.devMetadata.build.compression === "store" ? "UDRO" : "UDBZ", "-imagekey", "zlib-level=9", "-o", artifactPath]) - await exec("hdiutil", ["internet-enable", "-no", artifactPath]) + await spawn("hdiutil", addVerboseIfNeed(["convert", tempDmg, "-format", packager.devMetadata.build.compression === "store" ? "UDRO" : "UDBZ", "-imagekey", "zlib-level=9", "-o", artifactPath])) + await exec("hdiutil", addVerboseIfNeed(["internet-enable", "-no"]).concat(artifactPath)) this.packager.dispatchArtifactCreated(artifactPath, `${appInfo.name}-${appInfo.version}.dmg`) } @@ -263,8 +262,9 @@ export async function attachAndExecute(dmgPath: string, readWrite: boolean, task if (readWrite) { args.push("-readwrite") } + addVerboseIfNeed(args) args.push(dmgPath) - const attachResult = await exec("hdiutil", args, {maxBuffer: 1024 * 1024}) + const attachResult = await exec("hdiutil", args, {maxBuffer: 2 * 1024 * 1024}) const deviceResult = attachResult == null ? null : /^(\/dev\/\w+)/.exec(attachResult) const device = deviceResult == null || deviceResult.length !== 2 ? null : deviceResult[1] if (device == null) { @@ -272,4 +272,11 @@ export async function attachAndExecute(dmgPath: string, readWrite: boolean, task } await executeFinally(task(), () => detach(device)) +} + +function addVerboseIfNeed(args: Array): Array { + if (debug.enabled) { + args.push("-verbose") + } + return args } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 8df75b470d1..7b332aedc20 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,26 +1,21 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 - - -"@develar/semantic-release@^6.3.13": - version "6.3.13" - resolved "https://registry.yarnpkg.com/@develar/semantic-release/-/semantic-release-6.3.13.tgz#849dd018d1d845746247dad7818d3fb79f46469c" +"@develar/semantic-release@^6.3.17": + version "6.3.17" + resolved "https://registry.yarnpkg.com/@develar/semantic-release/-/semantic-release-6.3.17.tgz#1a41b85269079860b7e7b491f3c17f83613bb753" dependencies: "@semantic-release/commit-analyzer" "^2.0.0" - "@semantic-release/condition-travis" "^5.0.0" "@semantic-release/error" "^1.0.0" - "@semantic-release/last-release-npm" "^1.2.1" + bluebird-lst-c "^1.0.2" conventional-changelog "^1.1.0" + conventional-commits-parser "^1.3.0" + debug "^2.2.0" + fs-extra-p "^2.0.3" git-head "^1.14.0" github "^5.3.3" - ini "^1.3.4" - lodash "^4.16.4" - nerf-dart "^1.0.0" - nopt "^3.0.6" normalize-package-data "^2.3.5" - npmlog "^4.0.0" + npm-registry-client "^7.3.0" parse-github-repo-url "^1.3.0" - rc "^1.1.6" require-relative "^0.8.7" run-auto "^2.0.0" run-series "^1.1.4" @@ -33,26 +28,10 @@ dependencies: conventional-changelog "0.0.17" -"@semantic-release/condition-travis@^5.0.0": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@semantic-release/condition-travis/-/condition-travis-5.0.1.tgz#eb5355c9b594005a406976a97ab3f1a7f967532f" - dependencies: - "@semantic-release/error" "^1.0.0" - semver "^5.0.3" - travis-after-all "^1.3.0" - "@semantic-release/error@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@semantic-release/error/-/error-1.0.0.tgz#bb8f8eeedd5c7f8c46f96b37ef39e1b8c376c1cc" -"@semantic-release/last-release-npm@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@semantic-release/last-release-npm/-/last-release-npm-1.2.1.tgz#ff748142ecf15354b833a86ba18205f7fce594ee" - dependencies: - "@semantic-release/error" "^1.0.0" - npm-registry-client "^7.0.1" - npmlog "^1.2.1" - "@types/ini@^1.3.29": version "1.3.29" resolved "https://registry.yarnpkg.com/@types/ini/-/ini-1.3.29.tgz#1325e981e047d40d13ce0359b821475b97741d2f" @@ -62,8 +41,8 @@ resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.5.28.tgz#efd7614f8eb1b924c41235ff653b7370da467fac" "@types/node@*": - version "6.0.45" - resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.45.tgz#c4842a9d653d767831e4ff495b6008cc0d579966" + version "6.0.46" + resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.46.tgz#8d9e48572831f05b11cc4c793754d43437219d62" "@types/source-map-support@^0.2.28": version "0.2.28" @@ -136,10 +115,6 @@ ansi-styles@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.0.0.tgz#cb102df1c56f5123eab8b67cd7b98027a0279178" -ansi@^0.3.0, ansi@~0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/ansi/-/ansi-0.3.1.tgz#0c42d4fb17160d5a9af1e484bace1c66922c1b21" - anymatch@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" @@ -175,13 +150,6 @@ archiver@^1.1.0: tar-stream "^1.5.0" zip-stream "^1.1.0" -are-we-there-yet@~1.0.0: - version "1.0.6" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.0.6.tgz#a2d28c93102aa6cc96245a26cb954de06ec53f0c" - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.0 || ^1.1.13" - are-we-there-yet@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz#80e470e95a084794fe1899262c5667c6e88de1b3" @@ -1005,8 +973,8 @@ babel-types@^6.13.0, babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.7. to-fast-properties "^1.0.1" babylon@^6.1.0, babylon@^6.1.21, babylon@^6.11.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.13.0.tgz#58ed40dd2a8120612be5f318c2c0bedbebde4a0b" + version "6.13.1" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.13.1.tgz#adca350e088f0467647157652bafead6ddb8dfdb" balanced-match@^0.4.1: version "0.4.2" @@ -1477,7 +1445,7 @@ conventional-commits-filter@^1.0.0: is-subset "^0.1.1" modify-values "^1.0.0" -conventional-commits-parser@^1.0.0: +conventional-commits-parser@^1.0.0, conventional-commits-parser@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-1.3.0.tgz#e327b53194e1a7ad5dc63479ee9099a52b024865" dependencies: @@ -1882,7 +1850,7 @@ for-in@^0.1.5: version "0.1.6" resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8" -for-own@^0.1.3: +for-own@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.4.tgz#0149b41a39088c7515f51ebe1c1386d45f935072" dependencies: @@ -1960,16 +1928,6 @@ fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10: mkdirp ">=0.5 0" rimraf "2" -gauge@~1.2.0: - version "1.2.7" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-1.2.7.tgz#e9cec5483d3d4ee0ef44b60a7d99e4935e136d93" - dependencies: - ansi "^0.3.0" - has-unicode "^2.0.0" - lodash.pad "^4.1.0" - lodash.padend "^4.1.0" - lodash.padstart "^4.1.0" - gauge@~2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.6.0.tgz#d35301ad18e96902b4751dcbbe40f4218b942a46" @@ -2717,18 +2675,6 @@ lodash.keys@^3.0.0: lodash.isarguments "^3.0.0" lodash.isarray "^3.0.0" -lodash.pad@^4.1.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/lodash.pad/-/lodash.pad-4.5.1.tgz#4330949a833a7c8da22cc20f6a26c4d59debba70" - -lodash.padend@^4.1.0: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.padend/-/lodash.padend-4.6.1.tgz#53ccba047d06e158d311f45da625f4e49e6f166e" - -lodash.padstart@^4.1.0: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.padstart/-/lodash.padstart-4.6.1.tgz#d2e3eebff0d9d39ad50f5cbd1b52a7bce6bb611b" - lodash.restparam@^3.0.0: version "3.6.1" resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" @@ -2750,7 +2696,7 @@ lodash@^3.6.0: version "3.10.1" resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" -lodash@^4.0.0, lodash@^4.14.0, lodash@^4.16.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.5.1, lodash@^4.8.0: +lodash@^4.0.0, lodash@^4.14.0, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.5.1, lodash@^4.8.0: version "4.16.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.16.4.tgz#01ce306b9bad1319f2a5528674f88297aeb70127" @@ -2940,10 +2886,6 @@ ncp@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" -nerf-dart@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/nerf-dart/-/nerf-dart-1.0.0.tgz#e6dab7febf5ad816ea81cf5c629c5a0ebde72c1a" - node-pre-gyp@^0.6.29: version "0.6.31" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.31.tgz#d8a00ddaa301a940615dbcc8caad4024d58f6017" @@ -2966,7 +2908,7 @@ node-uuid@~1.4.7: version "1.4.7" resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.7.tgz#6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f" -nopt@^3.0.1, nopt@^3.0.6, nopt@~3.0.6: +nopt@^3.0.1, nopt@~3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" dependencies: @@ -3010,7 +2952,7 @@ normalize-path@^2.0.0, normalize-path@^2.0.1: hosted-git-info "^2.1.5" semver "^5.1.0" -npm-registry-client@^7.0.1: +npm-registry-client@^7.3.0: version "7.3.0" resolved "https://registry.yarnpkg.com/npm-registry-client/-/npm-registry-client-7.3.0.tgz#f2a390e8b13b78fafe26e9fa9d8bc74e17bcaa50" dependencies: @@ -3026,14 +2968,6 @@ npm-registry-client@^7.0.1: optionalDependencies: npmlog "~2.0.0 || ~3.1.0" -npmlog@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-1.2.1.tgz#28e7be619609b53f7ad1dd300a10d64d716268b6" - dependencies: - ansi "~0.3.0" - are-we-there-yet "~1.0.0" - gauge "~1.2.0" - npmlog@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.0.tgz#e094503961c70c1774eb76692080e8d578a9f88f" @@ -3081,10 +3015,10 @@ object-keys@~0.4.0: resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" object.omit@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.0.tgz#868597333d54e60662940bb458605dd6ae12fe94" + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" dependencies: - for-own "^0.1.3" + for-own "^0.1.4" is-extendable "^0.1.1" observable-to-promise@^0.4.0: @@ -3999,10 +3933,6 @@ traverse@^0.6.6: version "0.3.9" resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9" -travis-after-all@^1.3.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/travis-after-all/-/travis-after-all-1.4.4.tgz#c5a396f18404af634a65057b2c071da58923e49b" - trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -4057,8 +3987,8 @@ typedarray@~0.0.5: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" typescript@^2.1.0-dev.20161025: - version "2.1.0-dev.20161026" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.1.0-dev.20161026.tgz#9157eb9af6ee7d8c39ab8b8ba417ccf18c6069e7" + version "2.1.0-dev.20161027" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.1.0-dev.20161027.tgz#f6456102956dee194398fa1ad093b944c8db4f0a" uc.micro@^1.0.1, uc.micro@^1.0.3: version "1.0.3"