Skip to content

Inconsistent .yarnrc option handling for ignore-scripts #6893

@edmorley

Description

@edmorley

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions