Skip to content

Commit

Permalink
fix(generic): add yarn 0.27.5 to the whitelist, but only for darwin/l…
Browse files Browse the repository at this point in the history
…inux
  • Loading branch information
malept committed Aug 24, 2017
1 parent 7ea4981 commit 88b92fc
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/util/check-system.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,23 @@ async function checkNodeVersion() {
return Promise.resolve(semver.gt(process.versions.node, '6.0.0'));
}

const NPM_WHITELISTED_VERSIONS = '^3.0.0 || ^4.0.0 || ~5.1.0 || ~5.2.0 || >= 5.4.0';
const YARN_WHITELISTED_VERSIONS = '0.23.3 || 0.24.6';
const NPM_WHITELISTED_VERSIONS = {
all: '^3.0.0 || ^4.0.0 || ~5.1.0 || ~5.2.0 || >= 5.4.0',
};
const YARN_WHITELISTED_VERSIONS = {
all: '0.23.3 || 0.24.6',
darwin: '0.27.5',
linux: '0.27.5',
};

function warnIfPackageManagerIsntAKnownGoodVersion(packageManager, version, whitelistedVersions) {
if (!semver.satisfies(version, whitelistedVersions)) {
const osVersions = whitelistedVersions[process.platform];
const versions = osVersions ? `${whitelistedVersions.all} || ${osVersions}` : whitelistedVersions.all;
if (!semver.satisfies(version, versions)) {
console.warn(
logSymbols.warning,
(`You are using ${packageManager}, but not a known good version. The known ` +
`versions that work with Electron Forge are: ${whitelistedVersions}`).yellow
`versions that work with Electron Forge are: ${versions}`).yellow
);
}
}
Expand Down

0 comments on commit 88b92fc

Please sign in to comment.