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

Fix colors option when using wildcard commands #286

Merged
merged 10 commits into from
Oct 2, 2021

Conversation

daniloraisi
Copy link
Contributor

@daniloraisi daniloraisi commented Sep 23, 2021

This PR fix Issues #186, #210, and #234

Now when executing the command

concurrently -c "cyan,yellow" "npm:start-*"

will produce the same result as

concurrently -c "cyan,yellow" "npm:start-ng" "npm:start-server"

When mixing commands like

concurrently -k -c cyan,yellow,green "bash foo.sh" "npm:start-*"
concurrently -k -c cyan,yellow,green "npm:start-*" "bash foo.sh"

Will produce bash foo.sh to print as cyan or yellow respectively since the prefixColor attribution for plain commands use original index args passed to concurrently script.

Will produce bash foo.sh to print as cyan or green, since the attribution of prefixColor will happen after all commands are analyzed and prepared.

Copy link
Member

@gustavohenke gustavohenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for taking this on!

concurrently -k -c cyan,yellow,green "npm:start-*" "bash foo.sh"
Will produce bash foo.sh to print as cyan or green,

Did you mean yellow or green? Or am I missing something in your fix..?

src/concurrently.js Outdated Show resolved Hide resolved
@daniloraisi
Copy link
Contributor Author

Hey, thanks for taking this on!

concurrently -k -c cyan,yellow,green "npm:start-*" "bash foo.sh"
Will produce bash foo.sh to print as cyan or green,

Did you mean yellow or green? Or am I missing something in your fix..?

@gustavohenke when using this command concurrently -k -c cyan,yellow,green "npm:start-*" "bash foo.sh" the right thing is to color the output for bash foo.sh with the last color available.

Suppose you have only one script that matches npm:start-*. It will use cyan, so yellow will be the color used for the other command. For example, if you have two scripts that match npm:start-*, the last available color will be green, so bash foo.sh will be green.

@coveralls
Copy link

coveralls commented Sep 27, 2021

Coverage Status

Coverage increased (+0.02%) to 98.588% when pulling 6dbd1e8 on daniloraisi:master into 105445c on open-cli-tools:master.

Copy link
Member

@gustavohenke gustavohenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daniloraisi I've pushed a couple of changes to your branch to make prefixes specified per command be preferred over those specified in the prefixColors option, plus added some docs and test.

We should be good to ship this now 🙌

@gustavohenke
Copy link
Member

Fix out in v6.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants