From 115f25165afa1b8336d189c86d9d502db99f0553 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 18 Jun 2021 16:40:00 +0100 Subject: [PATCH] Rename hak target to runtime version The hak environment's `target` is more like a runtime version, so this renames to call it that, especially since we're about to add more traditional target strings. `npm_config_target` remains, since that's what `npm` expects. --- scripts/hak/hakEnv.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/hak/hakEnv.js b/scripts/hak/hakEnv.js index 22b915a..46fc68b 100644 --- a/scripts/hak/hakEnv.js +++ b/scripts/hak/hakEnv.js @@ -33,7 +33,7 @@ function getRuntime(packageJson) { return electronVersion ? 'electron' : 'node-webkit'; } -function getTarget(packageJson) { +function getRuntimeVersion(packageJson) { const electronVersion = getElectronVersion(packageJson); if (electronVersion) { return electronVersion; @@ -63,7 +63,7 @@ module.exports = class HakEnv { Object.assign(this, { // what we're targeting runtime: getRuntime(packageJson), - target: getTarget(packageJson), + runtimeVersion: getRuntimeVersion(packageJson), platform: process.platform, arch: detectArch(), @@ -76,7 +76,7 @@ module.exports = class HakEnv { getRuntimeAbi() { return nodePreGypVersioning.get_runtime_abi( this.runtime, - this.target, + this.runtimeVersion, ); } @@ -99,11 +99,11 @@ module.exports = class HakEnv { makeGypEnv() { return Object.assign({}, process.env, { - npm_config_target: this.target, npm_config_arch: this.arch, npm_config_target_arch: this.arch, npm_config_disturl: 'https://atom.io/download/electron', npm_config_runtime: this.runtime, + npm_config_target: this.runtimeVersion, npm_config_build_from_source: true, npm_config_devdir: path.join(os.homedir(), ".electron-gyp"), });