-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Don't use stdin unless --stdin
flag is specified
#17
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before: ------- ``` $ echo '' | FORCE_COLOR=1 node cli.js green 'this is a test' Invalid style: this is a test ``` After: ``` $ echo '' | FORCE_COLOR=1 node cli.js green 'this is a test' this is a test $ echo '' | FORCE_COLOR=1 node cli.js green 'this is a test' | cat this is a test $ echo 'text from stdin' | node cli.js --stdin green text from stdin ``` Fixes: chalkGH-11
sindresorhus
requested changes
Sep 12, 2021
You also need to update the readme. |
1. Put `--stdin` stuff after `--template` in two places. 2. `cli.flags.stdin !== true` => `!cli.flags.stdin` 3. Update `readme.md`
Thanks, @sindresorhus! I made the updates you requested in 915e1a6. If you want other changes or want me to squash, let me know. |
Qix-
approved these changes
Sep 12, 2021
sindresorhus
changed the title
Don't use stdin unless --stdin specfied
Don't use stdin unless Sep 13, 2021
--stdin
flag is specified
msabramo
added a commit
to msabramo/chalk-cli
that referenced
this pull request
Sep 13, 2021
While editing `readme.md` for chalkGH-17, I noticed that VS Code was formatting lines with tabs for indentation and that it looked bad in the diffs, because it wasn't matching the existing lines. Ths updates `.editconfig` so that it uses spaces for indentation in Markdown files, which seems to match what has been used.
Merged
msabramo
added a commit
to msabramo/chalk-cli
that referenced
this pull request
Sep 13, 2021
While editing `readme.md` for chalkGH-17, I noticed that VS Code was formatting lines with tabs for indentation and that it looked bad in the diffs, because it wasn't matching the existing lines. Ths updates `.editconfig` so that it uses spaces for indentation in Markdown files, which seems to match what has been used. ``` $ git diff readme.md diff --git a/readme.md b/readme.md index 5a21992..e0f2c4a 100644 --- a/readme.md +++ b/readme.md @@ -24,6 +24,8 @@ $ chalk --help Options --template, -t Style template. The `~` character negates the style. --demo Demo of all Chalk styles. + --fake-flag1 Fake flag added BEFORE updating .editorconfig to use spaces for Markdown files + --fake-flag2 Fake flag added AFTER updating .editorconfig to use spaces for Markdown files Examples $ chalk red bold 'Unicorns & Rainbows' ```
msabramo
added a commit
to msabramo/chalk-cli
that referenced
this pull request
Sep 13, 2021
While editing `readme.md` for chalkGH-17, I noticed that VS Code was formatting lines with tabs for indentation and that it looked bad in the diffs, because it wasn't matching the existing lines. Ths updates `.editconfig` so that it uses spaces for indentation in Markdown files, which seems to match what has been used. ``` $ git diff readme.md diff --git a/readme.md b/readme.md index 5a21992..e0f2c4a 100644 --- a/readme.md +++ b/readme.md @@ -24,6 +24,8 @@ $ chalk --help Options --template, -t Style template. The `~` character negates the style. --demo Demo of all Chalk styles. + --fake-flag1 Fake flag added BEFORE updating .editorconfig to use spaces for Markdown files + --fake-flag2 Fake flag added AFTER updating .editorconfig to use spaces for Markdown files Examples $ chalk red bold 'Unicorns & Rainbows' ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before:
After:
Fixes #11