Skip to content

Commit

Permalink
Add hostArch from Electron Forge
Browse files Browse the repository at this point in the history
  • Loading branch information
malept committed Sep 13, 2017
1 parent 27f4f73 commit 4174455
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions targets.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,18 @@ function warnIfAllNotSpecified (opts, message) {
}
}

function hostArch () {
/* istanbul ignore if */
if (process.arch === 'arm' && process.config.variables.arm_version === '7') {
return 'armv7l'
}

return process.arch
}

module.exports = {
createPlatformArchPairs: createPlatformArchPairs,
hostArch: hostArch,
officialArchs: officialArchs,
officialPlatformArchCombos: officialPlatformArchCombos,
officialPlatforms: officialPlatforms,
Expand All @@ -84,8 +94,16 @@ module.exports = {
validateListFromOptions: function validateListFromOptions (opts, name) {
if (opts.all) return Array.from(supported[name].values())

let list = opts[name] || process[name]
if (list === 'all') return Array.from(supported[name].values())
let list = opts[name]
if (!list) {
if (name === 'arch') {
list = hostArch()
} else {
list = process[name]
}
} else if (list === 'all') {
return Array.from(supported[name].values())
}

if (!Array.isArray(list)) {
if (typeof list === 'string') {
Expand Down

0 comments on commit 4174455

Please sign in to comment.