Skip to content

Commit

Permalink
fix(s3): S3-DEPLOY with parenthesis / spaces in product name broken i…
Browse files Browse the repository at this point in the history
…n 1.6.2

Close #1439
  • Loading branch information
develar committed Apr 7, 2017
1 parent 3d25690 commit 26ae6ec
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/Developer API.md
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@

| Param | Type |
| --- | --- |
| opts | <code>module:electron-macos-sign.SignOptions</code> |
| opts | <code>module:electron-osx-sign.SignOptions</code> |

<a name="module_electron-builder/out/macPackager.MacPackager+prepareAppInfo"></a>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"cuint": "^0.2.2",
"debug": "^2.6.3",
"electron-download-tf": "4.1.1",
"electron-macos-sign": "~1.6.0",
"electron-osx-sign": "0.4.4",
"fs-extra-p": "^4.1.0",
"hosted-git-info": "^2.4.1",
"ini": "^1.3.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"electron-builder-http": "0.0.0-semantic-release",
"electron-builder-util": "0.0.0-semantic-release",
"electron-download-tf": "4.1.1",
"electron-macos-sign": "~1.6.0",
"electron-osx-sign": "0.4.4",
"electron-publish": "0.0.0-semantic-release",
"fs-extra-p": "^4.1.0",
"hosted-git-info": "^2.4.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/src/macPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Arch, DIR_TARGET, Platform, Target } from "electron-builder-core"
import { exec, isPullRequest } from "electron-builder-util"
import { deepAssign } from "electron-builder-util/out/deepAssign"
import { log, task, warn } from "electron-builder-util/out/log"
import { signAsync, SignOptions } from "electron-macos-sign"
import { signAsync, SignOptions } from "electron-osx-sign"
import { ensureDir } from "fs-extra-p"
import * as path from "path"
import { AppInfo } from "./appInfo"
Expand Down
8 changes: 1 addition & 7 deletions packages/electron-publisher-s3/src/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class S3Client {
}

createFileUploader(localFile: string, target: string, s3Options: any) {
return new Uploader(this, Object.assign({Key: encodeSpecialCharacters(target)}, s3Options), localFile)
return new Uploader(this, Object.assign({Key: target}, s3Options), localFile)
}
}

Expand Down Expand Up @@ -314,12 +314,6 @@ function compareMultipartETag(eTag: string | null | undefined, multipartETag: an
return multipartETag.anyMatch(cleanETag(eTag))
}

function encodeSpecialCharacters(filename: string) {
// Note: these characters are valid in URIs, but S3 does not like them for
// some reason.
return encodeURI(filename).replace(/[!'()* ]/g, char => `%${char.charCodeAt(0).toString(16)}`)
}

function smallestPartSizeFromFileSize(fileSize: number) {
const partSize = Math.ceil(fileSize / MAX_MULTIPART_COUNT)
return partSize < MIN_MULTIPART_SIZE ? MIN_MULTIPART_SIZE : partSize
Expand Down
2 changes: 1 addition & 1 deletion test/src/helpers/CheckingPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import OsXPackager from "electron-builder/out/macPackager"
import { DmgTarget } from "electron-builder/out/targets/dmg"
import { SignOptions } from "electron-builder/out/windowsCodeSign"
import { WinPackager } from "electron-builder/out/winPackager"
import { SignOptions as MacSignOptions } from "electron-macos-sign"
import { SignOptions as MacSignOptions } from "electron-osx-sign"

export class CheckingWinPackager extends WinPackager {
effectiveDistOptions: any
Expand Down
6 changes: 3 additions & 3 deletions test/src/ignoreTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ test.ifNotCiMac("ignore node_modules dev dep", app({
return BluebirdPromise.all([
modifyPackageJson(projectDir, data => {
data.devDependencies = Object.assign({
"electron-macos-sign": "*",
"electron-osx-sign": "*",
}, data.devDependencies)
}),
outputFile(path.join(projectDir, "node_modules", "electron-macos-sign", "package.json"), "{}"),
outputFile(path.join(projectDir, "node_modules", "electron-osx-sign", "package.json"), "{}"),
// outputFile(path.join(projectDir, "ignoreMe"), ""),
])
},
packed: context => {
return BluebirdPromise.all([
assertThat(path.join(context.getResources(Platform.LINUX), "app", "node_modules", "electron-macos-sign")).doesNotExist(),
assertThat(path.join(context.getResources(Platform.LINUX), "app", "node_modules", "electron-osx-sign")).doesNotExist(),
assertThat(path.join(context.getResources(Platform.LINUX), "app", "ignoreMe")).doesNotExist(),
])
},
Expand Down
2 changes: 1 addition & 1 deletion test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"../node_modules/@types/jest/index.d.ts",
"../node_modules/fs-extra-p/index.d.ts",
"../node_modules/bluebird-lst/index.d.ts",
"../node_modules/electron-macos-sign/index.d.ts"
"../node_modules/electron-osx-sign/index.d.ts"
],
"include": [
"../typings/*.d.ts",
Expand Down
33 changes: 23 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"

debug@^2.1.1, debug@^2.1.3, debug@^2.2.0, debug@^2.6.0, debug@^2.6.3:
debug@^2.1.1, debug@^2.1.3, debug@^2.2.0, debug@^2.6.1, debug@^2.6.3:
version "2.6.3"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d"
dependencies:
Expand Down Expand Up @@ -1068,15 +1068,17 @@ [email protected]:
semver "^5.3.0"
sumchecker "^2.0.2"

electron-macos-sign@~1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/electron-macos-sign/-/electron-macos-sign-1.6.0.tgz#56af59012dda368614222f9a3df2fd2fbe13ef31"
electron-osx-sign@0.4.4:
version "0.4.4"
resolved "https://registry.yarnpkg.com/electron-osx-sign/-/electron-osx-sign-0.4.4.tgz#afdf38450ccaebe6dabeca71fb0fad6294a8c57c"
dependencies:
bluebird "^3.4.7"
compare-version "^0.1.2"
debug "^2.6.0"
debug "^2.6.1"
isbinaryfile "^3.0.2"
minimist "^1.2.0"
plist "^2.0.1"
tempfile "^1.1.1"

end-of-stream@^1.0.0:
version "1.4.0"
Expand Down Expand Up @@ -2418,7 +2420,7 @@ os-locale@^1.4.0:
dependencies:
lcid "^1.0.0"

os-tmpdir@^1.0.1:
os-tmpdir@^1.0.0, os-tmpdir@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"

Expand Down Expand Up @@ -2685,8 +2687,8 @@ regex-cache@^0.4.2:
is-primitive "^2.0.0"

registry-auth-token@^3.0.1:
version "3.1.0"
resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.1.0.tgz#997c08256e0c7999837b90e944db39d8a790276b"
version "3.1.1"
resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.1.1.tgz#1b93317b42527732f56f88c41b73b7bf855e05a5"
dependencies:
rc "^1.1.6"

Expand Down Expand Up @@ -3056,6 +3058,13 @@ temp-path@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/temp-path/-/temp-path-1.0.0.tgz#24b1543973ab442896d9ad367dd9cbdbfafe918b"

tempfile@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/tempfile/-/tempfile-1.1.1.tgz#5bcc4eaecc4ab2c707d8bc11d99ccc9a2cb287f2"
dependencies:
os-tmpdir "^1.0.0"
uuid "^2.0.1"

term-size@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/term-size/-/term-size-0.1.1.tgz#87360b96396cab5760963714cda0d0cbeecad9ca"
Expand Down Expand Up @@ -3182,8 +3191,8 @@ tslint@^5.0.0:
tsutils "^1.4.0"

tsutils@^1.4.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.5.0.tgz#36b571537827988b497244486a77792c8fc3563c"
version "1.6.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-1.6.0.tgz#1fd7fac2a61369ed99cd3997f0fbb437128850f2"

tunnel-agent@^0.6.0:
version "0.6.0"
Expand Down Expand Up @@ -3322,6 +3331,10 @@ [email protected], uuid@^3.0.0, uuid@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1"

uuid@^2.0.1:
version "2.0.3"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a"

validate-npm-package-license@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc"
Expand Down

0 comments on commit 26ae6ec

Please sign in to comment.