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

Yarn workspace does not propagate flags #7776

Closed
thevojacek opened this issue Dec 20, 2019 · 3 comments
Closed

Yarn workspace does not propagate flags #7776

thevojacek opened this issue Dec 20, 2019 · 3 comments
Assignees
Labels

Comments

@thevojacek
Copy link

@thevojacek thevojacek commented Dec 20, 2019

When using yarn workspaces with run command, flags are not passes into executed command.

How to reproduce:

yarn workspace test_workspace run start -- \
  serverURL="hello" \
  awsAccessKey="world"

package.json file contents.

{
  "scripts":
  {
    "start": "node script.js""
  }
}

Current behavior:

Flags are not passed into the running script.

Expected behavior:

Flags should be passed.

Environment

Node: 12.13.1
Yarn: 1.21.1
OS: macOS 10.14.6

@rally25rs
Copy link
Contributor

@rally25rs rally25rs commented Dec 28, 2019

confirmed against v1.21.1.

I'll try to see what's up with it. It's a bit tricky because yarn runs child process yarn runs child process node scripts.js so the flags have to get passed through a couple places.

@rally25rs rally25rs self-assigned this Dec 28, 2019
@rally25rs
Copy link
Contributor

@rally25rs rally25rs commented Dec 28, 2019

@thevojacek as a workaround, if you remove the -- then the parameters are passed correctly.
It looks like yarn trims off args after -- for some commands, including workspace.

rally25rs added a commit to rally25rs/yarn that referenced this issue Dec 29, 2019
…ace script

Passes arguments follwing `--` when running a workspace script (`yarn workspace pkg run command --
arg`). Previously these parameters were being trimmed off and ignored.

fixes yarnpkg#7776
@thevojacek
Copy link
Author

@thevojacek thevojacek commented Dec 29, 2019

@thevojacek as a workaround, if you remove the -- then the parameters are passed correctly.
It looks like yarn trims off args after -- for some commands, including workspace.

Thank you for investigation!

rally25rs added a commit to rally25rs/yarn that referenced this issue Dec 29, 2019
… running a workspace script

Passes arguments follwing `--` when running a workspace script (`yarn workspace pkg run command --
arg`). Previously these parameters were being trimmed off and ignored.

fixes yarnpkg#7776
arcanis added a commit that referenced this issue Jan 22, 2020
…pts (#7786)

* fix(workspaces): Passes arguments follwing "--" when running a workspace script

Passes arguments follwing `--` when running a workspace script (`yarn workspace pkg run command --
arg`). Previously these parameters were being trimmed off and ignored.

fixes #7776

* fix spelling in changelog

* fix(workspaces): fix(workspaces): Passes arguments follwing "--" when running a workspace script

Passes arguments follwing `--` when running a workspace script (`yarn workspace pkg run command --
arg`). Previously these parameters were being trimmed off and ignored.

fixes #7776

* don't ignore a parameter when running 'node' command
VincentBailly pushed a commit to VincentBailly/yarn that referenced this issue Jun 10, 2020
…pts (yarnpkg#7786)

* fix(workspaces): Passes arguments follwing "--" when running a workspace script

Passes arguments follwing `--` when running a workspace script (`yarn workspace pkg run command --
arg`). Previously these parameters were being trimmed off and ignored.

fixes yarnpkg#7776

* fix spelling in changelog

* fix(workspaces): fix(workspaces): Passes arguments follwing "--" when running a workspace script

Passes arguments follwing `--` when running a workspace script (`yarn workspace pkg run command --
arg`). Previously these parameters were being trimmed off and ignored.

fixes yarnpkg#7776

* don't ignore a parameter when running 'node' command
VincentBailly added a commit to VincentBailly/yarn that referenced this issue Jun 10, 2020
…pts (yarnpkg#7786)

* fix(workspaces): Passes arguments follwing "--" when running a workspace script

Passes arguments follwing `--` when running a workspace script (`yarn workspace pkg run command --
arg`). Previously these parameters were being trimmed off and ignored.

fixes yarnpkg#7776

* fix spelling in changelog

* fix(workspaces): fix(workspaces): Passes arguments follwing "--" when running a workspace script

Passes arguments follwing `--` when running a workspace script (`yarn workspace pkg run command --
arg`). Previously these parameters were being trimmed off and ignored.

fixes yarnpkg#7776

* don't ignore a parameter when running 'node' command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants