Yarn: Command-specific flags `--ignore-scripts` shouldn't be shown with `yarn help`

Created on 20 Feb 2017  Â·  10Comments  Â·  Source: yarnpkg/yarn

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

What is the current behavior?
yarn [command] --ignore-scripts does not ignore scripts

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

package.json:

{
  "scripts" : {
    "prebuild": "echo prebuild",
    "build": "echo build"
  }
}
$ yarn run build --ignore-scripts
yarn run v0.20.3
$ echo prebuild
prebuild
$ echo build
build
✨  Done in 0.25s.

What is the expected behavior?

$ yarn run build --ignore-scripts
yarn run v0.20.3
$ echo build
build
warning Ignored scripts due to flag.
✨  Done in 0.25s.

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

| what | version |
| --- | --- |
|node -v| 6.9.1|
|yarn -V|0.20.3|
|os-version:| OS X 10.11.6|

cat-bug good first issue help wanted triaged

Most helpful comment

I found the reason for my confusion:

yarn help run

  Usage: yarn [command] [flags]

  Options:

    -h, --help                          output usage information
    -V, --version                       output the version number
[...]
    --ignore-scripts                    don't run lifecycle scripts
[...]

I think the possible flags should be adjusted to allow only the ones that can be used with the command.
yarn help install lists a few more than yarn help run so I thought those flags can also be used with yarn run xyz.

All 10 comments

any update on this bug?

no changes with env:

| what | version |
| --- | --- |
|node -v| v8.1.0|
|yarn -V|0.27.5|
|os-version:| OS X 10.12.5|

I think --ignore-scripts is meant to stop running scripts when installing packages, not when running scripts themselves.

Why do you think this is the correct behavior? //cc @bestander @arcanis

It says that it keeps yarn from running lifecycle scripts. From my understanding that means pre and post scripts on any command.

The documentation lists --ignore-scripts in the yarn install command. The yarn run command has no such option (it has no option at all, actually), so the behaviour you're looking for just doesn't exists.

Ah my bad. Sorry

I found the reason for my confusion:

yarn help run

  Usage: yarn [command] [flags]

  Options:

    -h, --help                          output usage information
    -V, --version                       output the version number
[...]
    --ignore-scripts                    don't run lifecycle scripts
[...]

I think the possible flags should be adjusted to allow only the ones that can be used with the command.
yarn help install lists a few more than yarn help run so I thought those flags can also be used with yarn run xyz.

Any updates on this?
It strikes me as a pretty easy fix. I'm mostly an app developer, so I may be way off here :)

Is it a good issue for a first timer?

@goldylucks it has the good first issue tag so looks like it. Why don't you give it a shot and see how it goes?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NonPolynomial picture NonPolynomial  Â·  3Comments

ocolot picture ocolot  Â·  3Comments

jviotti picture jviotti  Â·  3Comments

torifat picture torifat  Â·  3Comments

MunifTanjim picture MunifTanjim  Â·  3Comments