Skip to content

Commit

Permalink
fix: one file in asar archive got corrupted
Browse files Browse the repository at this point in the history
Close #1400
  • Loading branch information
develar committed Mar 23, 2017
1 parent 4241521 commit e208f53
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 43 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"whitespace": "whitespace 'src/**/*.ts'",
"docker-images": "docker/build.sh",
"test-deps-mac": "brew install rpm dpkg mono lzip gnu-tar graphicsmagick xz && brew install wine --without-x11",
"update-deps": "lerna exec -- npm-check-updates --reject 'electron-builder-http,electron-builder-util,electron-builder-core,electron-publish' -a",
"update-deps": "lerna exec -- npm-check-updates --reject 'electron-builder-http,electron-builder-util,electron-builder-core,electron-publish,electron-forge-maker-' -a",
"set-versions": "node test/out/helpers/setVersions.js",
"npm-publish": "yarn compile && ./packages/npm-publish.sh && conventional-changelog -p angular -i CHANGELOG.md -s",
"schema": "typescript-json-schema packages/electron-builder/tsconfig.json Config --out packages/electron-builder/scheme.json --noExtraProps --useTypeOfKeyword --strictNullChecks",
Expand All @@ -31,7 +31,7 @@
"ajv": "^5.0.4-beta.0",
"ajv-keywords": "^2.0.1-beta.2",
"archiver": "^1.3.0",
"aws-sdk": "^2.30.0",
"aws-sdk": "^2.31.0",
"bluebird-lst": "^1.0.2",
"chalk": "^1.1.3",
"chromium-pickle-js": "^0.2.0",
Expand Down Expand Up @@ -67,7 +67,7 @@
"@types/ini": "^1.3.29",
"@types/jest": "^19.2.2",
"@types/js-yaml": "^3.5.29",
"@types/node-forge": "^0.6.7",
"@types/node-forge": "^0.6.8",
"@types/source-map-support": "^0.2.28",
"@types/xml2js": "^0.0.33",
"babel-plugin-array-includes": "^2.0.3",
Expand Down
17 changes: 10 additions & 7 deletions packages/electron-builder/src/asarUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,19 @@ export class AsarPackager {

const w = (index: number) => {
let data
while (index < files.length && (data = transformedFiles[index++]) == null) {
}

if (index >= files.length) {
writeStream.end()
return
while (true) {
if (index >= files.length) {
writeStream.end()
return
}

if ((data = transformedFiles[index++]) != null) {
break
}
}

const file = files[index - 1]
if (data !== true && data != null) {
if (data !== true) {
writeStream.write(data, () => w(index))
return
}
Expand Down
4 changes: 0 additions & 4 deletions packages/electron-builder/src/packager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,6 @@ function checkDependencies(dependencies: { [key: string]: string } | null | unde
+ `Please remove it from the "dependencies" section in your package.json.`)
}
}
if ("electron-compile" in dependencies) {
warn(`Package "electron-compile" should be in "devDependencies". `
+ `Please remove it from the "dependencies" section in your package.json. Please see https://github.com/electron/electron-compile/issues/207`)
}
}

export interface BuildResult {
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-publisher-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"dependencies": {
"fs-extra-p": "^4.1.0",
"aws-sdk": "^2.30.0",
"aws-sdk": "^2.31.0",
"mime": "^1.3.4",
"electron-publish": "~0.0.0-semantic-release",
"electron-builder-util": "~0.0.0-semantic-release"
Expand Down
4 changes: 4 additions & 0 deletions packages/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ const options = {

let hasErrors = false
for (const projectDir of require("./process").getPackages()) {
if (projectDir.includes("electron-forge-maker-")) {
continue
}

console.log(`Linting ${path.basename(projectDir)}`)
const program = Linter.createProgram("tsconfig.json", projectDir)
for (const file of Linter.getFileNames(program)) {
Expand Down
57 changes: 29 additions & 28 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
version "3.5.29"
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.5.29.tgz#29f4dd9314fbccb080d8bd84b9c23811ec5090c2"

"@types/node-forge@^0.6.7":
version "0.6.7"
resolved "https://registry.yarnpkg.com/@types/node-forge/-/node-forge-0.6.7.tgz#c63dadba64c10e3b90b473c9f16641c43ec26a29"
"@types/node-forge@^0.6.8":
version "0.6.8"
resolved "https://registry.yarnpkg.com/@types/node-forge/-/node-forge-0.6.8.tgz#fb38ae420be9c9b679bed3f974201120947b920f"

"@types/node@*":
version "7.0.8"
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.8.tgz#25e4dd804b630c916ae671233e6d71f6ce18124a"
version "7.0.10"
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.10.tgz#d860abb18c1b58b552c7c6cd8b2ba7adf6546fa3"

"@types/source-map-support@^0.2.28":
version "0.2.28"
Expand Down Expand Up @@ -271,9 +271,9 @@ asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"

aws-sdk@^2.30.0:
version "2.30.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.30.0.tgz#9d6d3b665e18fb7b9b9481092ea4d1ee1bfeed63"
aws-sdk@^2.31.0:
version "2.31.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.31.0.tgz#e17480610ebddad57732918a4849f9e5f4ade44d"
dependencies:
buffer "4.9.1"
crypto-browserify "1.0.9"
Expand Down Expand Up @@ -407,12 +407,12 @@ 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@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.0.0.tgz#36bde8fbef4837e5ff0366531a2beabd7b1ffa10"
version "4.1.1"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.1.tgz#c12de0fc6fe42adfb16be56f1ad11e4a9782eca9"
dependencies:
find-up "^2.1.0"
istanbul-lib-instrument "^1.4.2"
test-exclude "^4.0.0"
istanbul-lib-instrument "^1.6.2"
test-exclude "^4.0.3"

babel-plugin-jest-hoist@^19.0.0:
version "19.0.0"
Expand Down Expand Up @@ -1626,9 +1626,9 @@ isbinaryfile@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.2.tgz#4a3e974ec0cba9004d3fc6cde7209ea69368a621"

isexe@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-1.1.2.tgz#36f3e22e60750920f5e7241a476a8c6a42275ad0"
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"

isobject@^2.0.0:
version "2.1.0"
Expand All @@ -1641,14 +1641,14 @@ isstream@~0.1.2:
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"

istanbul-api@^1.1.0-alpha.1:
version "1.1.5"
resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.5.tgz#3ddb38f11183196da8f6e5c90c938cd3917b16a7"
version "1.1.6"
resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.6.tgz#23aa5b5b9b1b3bdbb786f039160e91acbe495433"
dependencies:
async "^2.1.4"
fileset "^2.0.2"
istanbul-lib-coverage "^1.0.0"
istanbul-lib-hook "^1.0.4"
istanbul-lib-instrument "^1.6.1"
istanbul-lib-instrument "^1.6.2"
istanbul-lib-report "^1.0.0-alpha.3"
istanbul-lib-source-maps "^1.1.0"
istanbul-reports "^1.0.0"
Expand All @@ -1666,9 +1666,9 @@ istanbul-lib-hook@^1.0.4:
dependencies:
append-transform "^0.4.0"

istanbul-lib-instrument@^1.1.1, istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.6.1:
version "1.6.1"
resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.6.1.tgz#6c9c3191ebd5aa856d66dc2f0b2f719c3732de2d"
istanbul-lib-instrument@^1.1.1, istanbul-lib-instrument@^1.6.2:
version "1.6.2"
resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.6.2.tgz#dac644f358f51efd6113536d7070959a0111f73b"
dependencies:
babel-generator "^6.18.0"
babel-template "^6.16.0"
Expand Down Expand Up @@ -3070,7 +3070,7 @@ term-size@^0.1.0:
dependencies:
execa "^0.4.0"

test-exclude@^4.0.0:
test-exclude@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.0.3.tgz#86a13ce3effcc60e6c90403cf31a27a60ac6c4e7"
dependencies:
Expand Down Expand Up @@ -3231,12 +3231,13 @@ typical@^2.4.2, typical@^2.6.0:
resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.0.tgz#89d51554ab139848a65bcc2c8772f8fb450c40ed"

uglify-js@^2.6:
version "2.8.14"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.14.tgz#25b15d1af39b21752ee33703adbf432e8bc8f77d"
version "2.8.15"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.15.tgz#835dd4cd5872554756e6874508d0d0561704d94d"
dependencies:
source-map "~0.5.1"
uglify-to-browserify "~1.0.0"
yargs "~3.10.0"
optionalDependencies:
uglify-to-browserify "~1.0.0"

uglify-js@~2.3:
version "2.3.6"
Expand Down Expand Up @@ -3390,10 +3391,10 @@ which-module@^1.0.0:
resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f"

which@^1.1.1, which@^1.2.12, which@^1.2.8:
version "1.2.12"
resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192"
version "1.2.14"
resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5"
dependencies:
isexe "^1.1.1"
isexe "^2.0.0"

whitespace@^2.1.0:
version "2.1.0"
Expand Down

0 comments on commit e208f53

Please sign in to comment.