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

Inconsistent .yarnrc option handling for ignore-scripts #6893

Closed
edmorley opened this issue Jan 9, 2019 · 0 comments
Closed

Inconsistent .yarnrc option handling for ignore-scripts #6893

edmorley opened this issue Jan 9, 2019 · 0 comments
Assignees

Comments

@edmorley
Copy link
Contributor

edmorley commented Jan 9, 2019

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
There are two ways to set the --ignore-scripts CLI option via a project-root .yarnrc:

# First method
ignore-scripts true

...and:

# Second method
--ignore-scripts true

Whilst the first method appears to work fine (since the yarn install output starts displaying messages like warning Ignored scripts due to flag.), it doesn't cause the fix from #6820 to take effect. eg:

yarn-test $ yarn add --pnp webpack-cli@3.2.1
yarn add v1.13.0
...
[5/5] Building fresh packages...
warning Ignored scripts due to flag.
...
Done in 1.29s.
yarn-test $ ls .pnp/unplugged/
npm-webpack-cli-3.2.1-779c696c82482491f0803907508db2e276ed3b61/

Instead if the second method is used, then both the console message and the plug and play fix take effect:

yarn-test $ yarn add --pnp webpack-cli@3.2.1
yarn add v1.13.0
...
[5/5] Building fresh packages...
warning Ignored scripts due to flag.
...
Done in 1.17s.
yarn-test $ ls .pnp/unplugged/
ls: cannot access '.pnp/unplugged/': No such file or directory

If the current behavior is a bug, please provide the steps to reproduce.

  1. mkdir yarn-test && cd $_
  2. echo 'ignore-scripts true' > .yarnrc
  3. yarn add --pnp webpack-cli@3.2.1 (this version of webpack-cli uses a postinstall script)
  4. ls .pnp/unplugged/

What is the expected behavior?
For either Yarn to fully accept ignore-scripts true as a valid way of specifying the option, or else not to accept it at all. (Rather than the current situation of it partially taking effect but not fully.)

Please mention your node.js, yarn and operating system version.
Yarn 1.13.0, Node 11.3.0, Windows 10 (example above using git bash)

CC @arcanis

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

4 participants
@rally25rs @edmorley @Gudahtt and others