Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: re-add support for iojs prefixed headers to support Electron 3 #1777

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/process-release.js
Expand Up @@ -17,6 +17,7 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
, versionSemver = semver.parse(version)
, overrideDistUrl = gyp.opts['dist-url'] || gyp.opts.disturl
, isDefaultVersion
, isNamedForLegacyIojs
, name
, distBaseUrl
, baseUrl
Expand All @@ -41,11 +42,17 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {

if (defaultRelease) {
// v3 onward, has process.release
name = defaultRelease.name
name = defaultRelease.name.replace(/io\.js/, 'iojs') // remove the '.' for directory naming purposes
} else {
// old node or alternative --target=
// semver.satisfies() doesn't like prerelease tags so test major directly
name = 'node'
isNamedForLegacyIojs = versionSemver.major >= 1 && versionSemver.major < 4
// isNamedForLegacyIojs is required to support Electron < 4 (in particular Electron 3)
// as previously this logic was used to ensure "iojs" was used to download iojs releases
// and "node" for node releases. Unfortunately the logic was broad enough that electron@3
// published release assets as "iojs" so that the node-gyp logic worked. Once Electron@3 has
// been EOL for a while (late 2019) we should remove this hack.
name = isNamedForLegacyIojs ? 'iojs' : 'node'
}

// check for the nvm.sh standard mirror env variables
Expand Down