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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn config set can't set --<command>.<flag> values #6499

Open
pixelastic opened this issue Oct 5, 2018 · 2 comments
Open

yarn config set can't set --<command>.<flag> values #6499

pixelastic opened this issue Oct 5, 2018 · 2 comments
Assignees
Labels

Comments

@pixelastic
Copy link

Hello yarn team 馃憢 ,

Do you want to request a feature or report a bug?
A bug 馃悰

What is the current behavior?
I'm trying to set --run.silent true to my .yarnrc through the use of yarn config set but the -- seem to throw the command off.

If the current behavior is a bug, please provide the steps to reproduce.
I tried the following syntaxes, but they all fail with error Invalid subcommand. Try "set, get, delete, list, current"

  • yarn config set --run.silent true
  • yarn config set "--run.silent" true
  • yarn config set \-\-run.silent true

What is the expected behavior?
Documentation of .yarnrc states that:
image

.yarnrc contains the comment # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY., making me think that the only way to set config is through yarn config set.

Documentation of yarn config states that:
image

Knowing all that, I would expect yarn config set to allow me to add ---prefixed values.

Please mention your node.js, yarn and operating system version.

  • node -v: v10.11.0
  • yarn -v: 1.12.0
  • Ubuntu 18.04
@ghost ghost assigned arcanis Oct 5, 2018
@ghost ghost added the triaged label Oct 5, 2018
@arcanis
Copy link
Member

arcanis commented Oct 5, 2018

.yarnrc contains the comment # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY., making me think that the only way to set config is through yarn config set.

Yep, that's the actual bug. The yarnrc file is totally safe to modify manually as long as you know what you're doing.

This header is just there because the same serializer is used to generate the lockfile, which IS generated and shouldn't be modified, and I guess it was easier at the beginning to just print the warning in every case. We should improve this.

@pixelastic
Copy link
Author

Ah thanks, that's good to know.

I was actually looking for a way to have .yarnrc as part of my dotfiles repo and symlink it to ~/.yarnrc on any fresh install. As the file seemed auto-generated I tried yarn config set instead, but if it's not needed I'll do a simple link.

That being said, my file does contain a lastUpdateCheck 1538717593702 line. I'm not sure what this is about, but my guess is that this value will evolve over time and if I symlink it will update my source file as well (which will be inconvenient).

I can live with having to manually set the value in the file for now, but I think solving the yarn config set parsing might be a better long-term solution.

Thanks for the clear and quick response, though

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

No branches or pull requests

2 participants