Skip to content

Commit

Permalink
Allow emojis to be force enabled with --emoji.
Browse files Browse the repository at this point in the history
The previous behaviour had a default of enabling emojis for Macs, and
allowed explicitly disabling them.

This PR keeps that default but allows `--emoji` to enable for other
platforms if the user wants to.  `--no-emoji` still works as before, but
due to the way that commander processes "--no-" flags (forcing the
default to true and overwriting the default value given in the `.option`
definition) it was necessary to switch the flag definition from
`--no-emoji` to `--emoji`.
  • Loading branch information
elyobo committed Apr 25, 2017
1 parent e4a5102 commit bef14fb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ commander.option(
'use a mutex to ensure only one yarn instance is executing',
);
commander.option(
'--no-emoji',
'disable emoji in output',
'--emoji',
'enable emoji in output',
process.platform === 'darwin',
);
commander.option(
'-s, --silent',
Expand Down Expand Up @@ -131,7 +132,7 @@ commander.args.shift();
//
const Reporter = commander.json ? JSONReporter : ConsoleReporter;
const reporter = new Reporter({
emoji: commander.emoji && process.stdout.isTTY && process.platform === 'darwin',
emoji: commander.emoji && process.stdout.isTTY,
verbose: commander.verbose,
noProgress: !commander.progress,
isSilent: commander.silent,
Expand Down

0 comments on commit bef14fb

Please sign in to comment.