This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 478
[expo-cli]<feat>: Add cmd.exe detection on windows & warn about it #2838
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
brentvatne
reviewed
Nov 5, 2020
ah, that's too bad. some ideas:
|
b96907b
to
82daca0
Compare
…cause it's shipped with windows binary
15248a8
to
bc32599
Compare
@brentvatne, I've adjusted the warning, detection process (removed the |
brentvatne
approved these changes
Dec 9, 2020
brentvatne
reviewed
Dec 9, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Resolves #2107
I've only succeeded in checking whether the
expo-cli
is run fromcmd.exe
.HOW
I've found a package that seems to be quite popular and behaves similar to
ps aux
: https://www.npmjs.com/package/ps-list.I'm using it to find the parent process of the current running program taking advantage of NodeJS API
process.ppid
.The problem with this approach is that on Windows we're querying the processes table and that is taking some time.
I've measured the timings on VMWare Fusion running Windows 10 and checking for
cmd.exe
takes~200ms
.PREVIEW
ABOUT
WSL
Unfortunately, I've failed to find any reliable way to distinguish between WSL v1 & v2.
There's a package that can detect running the script on WSL though (https://www.npmjs.com/package/is-wsl), but once we're in WSL we don't really need to warn about it 😅
Although there's a way to check WSL version:
it only runs in PowerShell/CMD, so we're unable to check from inside WSL what version we're running using this technique.