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

workspace run commands only when it exists #6739

Open
testerez opened this issue Nov 29, 2018 · 8 comments
Open

workspace run commands only when it exists #6739

testerez opened this issue Nov 29, 2018 · 8 comments

Comments

@testerez
Copy link

testerez commented Nov 29, 2018

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

What is the current behavior?
As specified in RFC yarn workspaces run <command> will fail if the command is missing in any package.

What is the expected behavior?
I'd like yarn to execute the command only on packages that have it. That would allow each package to opt-in by just declaring the desired commands. Note that this is how lerna does it by default.

Please mention your node.js, yarn and operating system version.
node v8.11.3
yarn 1.12.3
osx 10.13.6

@gaharavara
Copy link

gaharavara commented Dec 16, 2018

@rally25rs could you assign me this issue, I am new to the community, is there any IRC or gitter channel for the community?I have setup yarn on my machine

C:\Users\abhi\Documents\openGit\yarn>alias yarn-local="node $PWD/lib/cli/index.js"
'alias' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\abhi\Documents\openGit\yarn>

facing this issue while creating the test environment.

@peterlebrun
Copy link

peterlebrun commented Dec 20, 2018

Hi @rally25rs I have a PR for this. Apologies if I've done something wrong with the PR process: #6841

@dezson
Copy link

dezson commented Mar 21, 2019

Hi @AsociTon You can't use alias in Windows, that's a Linux command.

@dezson
Copy link

dezson commented Mar 21, 2019

Hi @testerez do you mean yarn workspaces run command instead of yarn workspace run command in your current behavior description?

@testerez
Copy link
Author

Right, @dezson. I updated my description. Thank!

@benedyktdryl
Copy link

@arcanis is this something you consider as sensible to implement? Should I work on it on this version or should contribute to Yarn 2.x (or both)?

@arcanis
Copy link
Member

arcanis commented Aug 26, 2019

Hey @benedyktdryl! This feature has actually been implemented (in the v2, so still developer preview) via the more powerful yarn workspaces foreach command, which only iterates on workspaces that define the script (when using the run subcommand).

That being said, we're always happy to welcome new contributors to the v2 - we have various issues tagged good first issue and help wanted, if you're interested to take a look 😊

@benedyktdryl
Copy link

Awesome, I will definitely check these labels, thanks!

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

7 participants