Skip to content
Permalink
Browse files

fix(generic): add yarn 0.27.5 to the whitelist, but only for darwin/l…

…inux
  • Loading branch information
malept committed Aug 24, 2017
1 parent 7ea4981 commit 88b92fce5fad685f4441f034f8947336cfdb7644
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/util/check-system.js
@@ -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
);
}
}

0 comments on commit 88b92fc

Please sign in to comment.
You can’t perform that action at this time.