From 87b5e5099f493ccb3e167912e13d1f4ea3e8d482 Mon Sep 17 00:00:00 2001 From: Jack Twilley Date: Tue, 12 Dec 2017 00:37:04 -0800 Subject: [PATCH] Moved hostArch() earlier in validateListFromOptions() This PR is in response to atom/atom#15431. When I tried to build Atom on my Chromebook running Arch Linux ARM, the automatic trigger detecting armv7l was not running because a value already existed for the arch. This change moves the hostArch() function before the list assignment to catch this case. When I run this code on my Chromebook, the packaging code appears to succeed. --- targets.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/targets.js b/targets.js index b4d06e8b..25f5594c 100644 --- a/targets.js +++ b/targets.js @@ -102,13 +102,14 @@ module.exports = { validateListFromOptions: function validateListFromOptions (opts, name) { if (opts.all) return Array.from(supported[name].values()) - let list = opts[name] + let list + if (name === 'arch') { + list = hostArch() + } else { + list = opts[name] + } if (!list) { - if (name === 'arch') { - list = hostArch() - } else { - list = process[name] - } + list = process[name] } else if (list === 'all') { return Array.from(supported[name].values()) } @@ -128,7 +129,6 @@ module.exports = { return unsupportedListOption(name, value, supported[name]) } } - return list } }