Skip to content

Commit

Permalink
fix: TypeError: s.trim is not a function on rpm and deb target
Browse files Browse the repository at this point in the history
Close #1784
  • Loading branch information
develar committed Jul 4, 2017
1 parent 98dd77a commit ab64a06
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/electron-builder/src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ export function normalizeOptions(args: CliOptions): BuildOptions {
(<any>result).config = config
}
(<any>config).extraMetadata = extraMetadata
}

if (config != null && typeof config !== "string" && config.extraMetadata != null) {
coerceTypes(config.extraMetadata)
}

Expand All @@ -187,6 +189,9 @@ export function coerceTypes(host: any): any {
else if (value === "null") {
host[key] = null
}
else if (key === "version" && typeof value === "number") {
host[key] = value.toString()
}

This comment has been minimized.

Copy link
@lurch

lurch Jul 4, 2017

@develar I think this is too specific to what we were doing on Etcher, and doesn't actually fix our problem, so maybe these three lines should be reverted?
ping @jviotti

Or then again, perhaps they are actually useful in case somebody does happen to use numeric-versioning instead of semver-versioning? *shrug*

This comment has been minimized.

Copy link
@develar

develar Jul 4, 2017

Author Member
  1. Why it doesn't fix your problem?
  2. It is strange that yargs convert number-like data to number. Anyway — All extraMetadata values expected to be string if not true/false or null. So, if " somebody does happen to use numeric-versioning instead of semver-versioning" — file issue :)

This comment has been minimized.

Copy link
@lurch

lurch Jul 4, 2017

2. I don't think it is (which is why I think these lines should be reverted)
1. Because I don't think 2. is actually the cause of our problem (I think @jviotti mis-identified the problem when trying to diagnose it). I think our problem is actually what I wrote in my comment here (although I'm waiting for @jviotti to come back online to verify that (we're in different timezones)).

else if (value != null && typeof value === "object") {
coerceTypes(value)
}
Expand Down

0 comments on commit ab64a06

Please sign in to comment.