Skip to content

Commit

Permalink
issue 2495: warn users when install yarn globally with yarn (yarnpkg#…
Browse files Browse the repository at this point in the history
  • Loading branch information
samjacobclift authored and bestander committed Mar 20, 2017
1 parent 5009417 commit 6e9a9a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cli/commands/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ const {run, setFlags: _setFlags} = buildSubCommands('global', {
await updateCwd(config);

const updateBins = await initUpdateBins(config, reporter, flags);
if (args.includes('yarn')) {
reporter.warn(reporter.lang('packageContainsYarnAsGlobal'));
}

// install module
const lockfile = await Lockfile.fromDirectory(config.cwd);
Expand Down
1 change: 1 addition & 0 deletions src/reporters/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ const messages = {
importFailed: 'Import of $0 for $1 failed, resolving normally.',
importResolveFailed: 'Import of $0 failed starting in $1',
importResolvedRangeMatch: 'Using version $0 of $1 instead of $2 for $3',
packageContainsYarnAsGlobal: 'Installing Yarn via Yarn will result in you having two separate versions of Yarn installed at the same time, which is not recommended. To update Yarn please follow https://yarnpkg.com/en/docs/install .',
};

export type LanguageKeys = $Keys<typeof messages>;
Expand Down

0 comments on commit 6e9a9a6

Please sign in to comment.