-
Notifications
You must be signed in to change notification settings - Fork 930
fix: open Metro in the correct terminal #310
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
Merged
grabbou
merged 23 commits into
react-native-community:master
from
lucasbento:feature/correct-terminal
Apr 17, 2019
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3787169
Put `isPackagerRunning` function on `cli-tools` to share between iOS …
8c7fb99
Fix `terminal` argument not working when not being provided
fd41e95
Fallback to the default terminal of the machine when starting the pac…
27d0792
Delete `isPackagerRunning` as it was moved to `tools`
fb1b91b
Add `terminal` argument to `run-ios`
9a18d84
Launch Metro from within the `runIOS` command
753b606
Remove code & add `—terminal` argument
ac9b684
Try using `REACT_TERMINAL` before the default terminal
119900a
Put `isPackagerRunning` function on `cli-tools` to share between iOS …
485e6fb
Fix `terminal` argument not working when not being provided
4249a49
Fallback to the default terminal of the machine when starting the pac…
29edba4
Delete `isPackagerRunning` as it was moved to `tools`
3c1500a
Add `terminal` argument to `run-ios`
97263a7
Launch Metro from within the `runIOS` command
9f54934
Remove code & add `—terminal` argument
e273506
Try using `REACT_TERMINAL` before the default terminal
5577cc3
Add tool function to get the default user terminal
5c9e283
Fix `terminal` arg type
e397a82
Remove spread and specify entry twice instead
62ca068
Merge branch 'feature/correct-terminal' of https://github.com/lucasbe…
c396b63
Improve `args` being passed through functions
aa6375e
Reduce code duplication
c4bb670
Put `device` and `udid` variable up in the scope
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| const getDefaultUserTerminal = (): ?string => | ||
| process.env.REACT_TERMINAL || process.env.TERM_PROGRAM; | ||
|
|
||
| export default getDefaultUserTerminal; |
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
File renamed without changes.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not clean, inside we need to branch 2 more times, which is not really more readable and efficient. What would you tell about this refactoring?
devicenorudid, we run on simulator straight away.matchingDevicefn (inliningmatchingDeviceByUdidinto it)deviceorudidwas passed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually prefer to return as early as possible, even if it needs to have negative conditionals, with a quick look I agree with the diff you sent.
@grabbou thoughts on this? Asking because you pointed that you didn't like the conditionals I introduced on previous commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually disagree this is not clean. The first branch is
runOnDevice- you can select device by name or id. The second branch isrunOnSimulator.Anyway, I don't have a strong preference here. Let's merge it as soon as possible as I want to ship it for next RC of React Native.
We can tweak it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS. I like @thymikee structure better, but at the same time, I feel like @lucasbento keeps doing tweaking that is far beyond his PR. I'd just get it merged to not discourage them from further PRs!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grabbou feel free to merge it as is now. Hopefully @lucasbento will not be discouraged by our nitpicks 😅