Fix total count in flow tracker#7813
Merged
vjeux merged 1 commit intofacebook:masterfrom Sep 27, 2016
Merged
Conversation
Contributor
Author
|
cc @zpao |
zpao
approved these changes
Sep 27, 2016
Member
zpao
left a comment
There was a problem hiding this comment.
I'll leave it up to you if you want to do what I suggested. Either way is fine.
| ./node_modules/.bin/grunt flow | ||
|
|
||
| ALL_FILES=`find src -name '*.js' | grep -v umd/ | grep -v __tests__ | grep -v __mocks__` | ||
| COUNT_ALL_FILES=`echo $ALL_FILES | wc -l` |
Member
There was a problem hiding this comment.
echo "$ALL_FILES" should work. I'd prefer that over ls as it's clearer intent.
Contributor
Author
There was a problem hiding this comment.
Omg, thanks! I couldn't figure out what I did wrong. Of course, sending it to the tokenizer of bash like this is going to interpret them as different arguments and be in one line when echo sees it! Good catch!
When you put the output of a bash command in a variable, it replaces the `\n` with a space. Using `ls` instead of `echo` fixes it Test Plan: Run ``` ALL_FILES=`find src -name '*.js' | grep -v umd/ | grep -v __tests__ | grep -v __mocks__` COUNT_ALL_FILES=`ls $ALL_FILES | wc -l` echo $COUNT_ALL_FILES ``` Make sure that it outputs 221
fbb8aa3 to
255ce18
Compare
zpao
pushed a commit
that referenced
this pull request
Oct 4, 2016
When you put the output of a bash command in a variable, it replaces the `\n` with a space. Using `ls` instead of `echo` fixes it Test Plan: Run ``` ALL_FILES=`find src -name '*.js' | grep -v umd/ | grep -v __tests__ | grep -v __mocks__` COUNT_ALL_FILES=`ls $ALL_FILES | wc -l` echo $COUNT_ALL_FILES ``` Make sure that it outputs 221 (cherry picked from commit 72ed5df)
acusti
pushed a commit
to brandcast/react
that referenced
this pull request
Mar 15, 2017
When you put the output of a bash command in a variable, it replaces the `\n` with a space. Using `ls` instead of `echo` fixes it Test Plan: Run ``` ALL_FILES=`find src -name '*.js' | grep -v umd/ | grep -v __tests__ | grep -v __mocks__` COUNT_ALL_FILES=`ls $ALL_FILES | wc -l` echo $COUNT_ALL_FILES ``` Make sure that it outputs 221
This file contains hidden or 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
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.
When you put the output of a bash command in a variable, it replaces the
\nwith a space. Usinglsinstead ofechofixes itTest Plan:
Run
Make sure that it outputs 221