Always write ANDROID_HOME and ANDROID_SDK_ROOT

Summary:
When flipper starts it writes to both env vars the value from settings. This is needed for subprocesses to have access to them.

The problem with the check for both env vars is
- In prod environment applications does not have access to them
- In dev, when developers launch flipper from terminal (`yarn run flipper-server`) it picks up these env vars if they are set which can cause different behaviour in dev and prod

To make flipper work more deterministic, for users and us. I removed this check and now we always write to these env vars what the user has provided in flipper settings or the default.

Reviewed By: lblasa

Differential Revision: D51266495

fbshipit-source-id: cf3adfd4ba83a733a30b5b0b29c270b32ff3a61a
This commit is contained in:
Anton Kastritskiy
2023-11-14 02:54:59 -08:00
committed by Facebook GitHub Bot
parent bc77dcf326
commit d88cf41a24

View File

@@ -75,10 +75,8 @@ function setProcessState(settings: Settings) {
const androidHome = settings.androidHome; const androidHome = settings.androidHome;
const idbPath = settings.idbPath; const idbPath = settings.idbPath;
if (!process.env.ANDROID_HOME && !process.env.ANDROID_SDK_ROOT) { process.env.ANDROID_HOME = androidHome;
process.env.ANDROID_HOME = androidHome; process.env.ANDROID_SDK_ROOT = androidHome;
process.env.ANDROID_SDK_ROOT = androidHome;
}
// emulator/emulator is more reliable than tools/emulator, so prefer it if // emulator/emulator is more reliable than tools/emulator, so prefer it if
// it exists // it exists