Closed
Description
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
Activity
rally25rs commentedon 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 processyarn
runs child processnode scripts.js
so the flags have to get passed through a couple places.rally25rs commentedon 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, includingworkspace
.fix(workspaces): Passes arguments follwing "--" when running a worksp…
thevojacek commentedon Dec 29, 2019
Thank you for investigation!
fix(workspaces): fix(workspaces): Passes arguments follwing "--" when…
fix(workspaces): Pass args following "--" when running workspace scri…
fix(workspaces): Pass args following "--" when running workspace scri…
fix(workspaces): Pass args following "--" when running workspace scri…