Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I disable emojis output by default ? #3660

Closed
jbiter opened this issue Jun 18, 2017 · 12 comments
Closed

How can I disable emojis output by default ? #3660

jbiter opened this issue Jun 18, 2017 · 12 comments

Comments

@jbiter
Copy link

jbiter commented Jun 18, 2017

I am using:
macOS Sierra 10.12.5
node v8.1.2
yarn v0.24.5

When I pass '--no-emoji' flag to a command explicitly, it works.
image

Then I tried config a default setting to my global .yarnrc file.
image

But it doesn't works.
image

So how can I disable emojis output by default setting ?

@ghost
Copy link

ghost commented Jun 18, 2017

Perform an IoC on the CLI and pass flags every time.

@deecewan
Copy link

you could do alias yarn="yarn --no-emoji" in your .profile/.bashrc/.zshrc

@arcanis
Copy link
Member

arcanis commented Jun 19, 2017

Or you can add --no-emoji true (or --emoji false) to your .yarnrc file.

@arcanis arcanis closed this as completed Jun 19, 2017
@FDiskas
Copy link

FDiskas commented Sep 5, 2017

@arcanis on old yarn version this will fail #2009 (comment)

@BYK
Copy link
Member

BYK commented Sep 5, 2017

@FDiskas we don't support this on older versions of yarn.

@FDiskas
Copy link

FDiskas commented Sep 10, 2017

Newest version (Stable: v1.0.1) on windows looks like same error ⭕
package.json

  "scripts": {
      "start": "webpack --watch"
  },

and then i run

yarn start

the output is

yarn start v1.0.1
error No command specified.
info Commands available from binary scripts: acorn, acorn.cmd, errno, errno.cmd, json5, json5.cmd, loose-envify, loose-envify.cmd, miller-rabin, miller-rabin.cmd, mkdirp, mkdirp.cmd,
semver, semver.cmd, sha.js, sha.js.cmd, tsc, tsc.cmd, tsserver, tsserver.cmd, uglifyjs, uglifyjs.cmd, webpack, webpack.cmd, which, which.cmd
info Project commands
   - start
      webpack --watch
question Which command would you like to run?:

And if I remove the --emoji true from .yarnrc file everything works fine.
And I can't install packages like

yarn add awesome-typescript-loader -D

Got an error

error Missing list of packages to add to your project.

@BYK
Copy link
Member

BYK commented Sep 13, 2017

Looks like a missing feature to me: yarn config set emoji false

Would you be interested in adding this in a PR?

@FDiskas
Copy link

FDiskas commented Sep 13, 2017

For me it would be cool

@BYK
Copy link
Member

BYK commented Sep 14, 2017

If anyone is interested in a PR, I'd be more than happy to support the effort.

@olingern
Copy link
Contributor

olingern commented Sep 21, 2017

@BYK looks related to #4457

EDIT: Looked at this more while @BrooklyJS. Found some interesting issue, i.e. precedence of settings.

Scenarios found:

  • user doesn't set emoji on cmd line.
  • user sets on cmd line
  • user sets on cmd line and in yarn config
    ...
    I think the possible combinations is somewhere around 3^3*

Given that, @BYK what precedence should be preferred:

  1. cmd line
  2. local yarn config
  3. global yarn config

?

cc @courajs

@courajs
Copy link

courajs commented Sep 22, 2017

@olingern thanks for pairing and showing me some yarn internals!

I think that precedence looks right.

There's one main hard part to this feature. The Reporter is what needs to know whether to show emoji or not, but it's instantiated before configuration is loaded (here), and actually is required for instantiating the Config object.
So we probably need to a) decouple these more somehow, b) do some state wrangling to update the reporter with emoji info after it's created, or c) read config info via some other mechanism for this option only.

There's also a small wrinkle in that right now commander is defaulting the emoji flag to true, unless --emoji false or --no-emoji are passed - we can't tell just from commander.emoji whether the user passed --emoji true or didn't specify the flag at all. I think it's pretty important to use the flag if it's passed, but fall back to config if not specified.

@BYK
Copy link
Member

BYK commented Sep 24, 2017

This should be fine on master now (latest nightlies or v1.1.0). Commander is pretty tricky so right now the "proper" way to do this is to pass --emoji false or --emoji 0 either on the command line or in .yarnrc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants