Skip to content

Commit

Permalink
lib: reintroduce support for iojs file naming for releases >= 1 && < 4
Browse files Browse the repository at this point in the history
For Electron 3

PR-URL: #1777
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Rod Vagg <[email protected]>
  • Loading branch information
MarshallOfSound authored and rvagg committed Jun 20, 2019
1 parent e386172 commit 1cfdb28
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/process-release.js
Original file line number Diff line number Diff line change
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

0 comments on commit 1cfdb28

Please sign in to comment.