Default path to Android SDK is wrong on Windows
Summary: Default path for Android SDK was set to "/opt/android_sdk" disregard the current OS. On Windows it should be set to "%localappdata%\android\sdk" instead. Reviewed By: passy Differential Revision: D19496646 fbshipit-source-id: 86ce7df74b98eef5b7b0a556a5359bec8cb0dbc4
This commit is contained in:
committed by
Facebook Github Bot
parent
35d62e70cb
commit
e178221f44
@@ -8,6 +8,8 @@
|
||||
*/
|
||||
|
||||
import {Actions} from './index';
|
||||
import os from 'os';
|
||||
import electron from 'electron';
|
||||
|
||||
export enum Tristate {
|
||||
True,
|
||||
@@ -40,8 +42,14 @@ export type Action =
|
||||
payload: Settings;
|
||||
};
|
||||
|
||||
function getWindowsSdkPath() {
|
||||
const app = electron.app || electron.remote.app;
|
||||
return `${app.getPath('userData')}\\android\\sdk`;
|
||||
}
|
||||
|
||||
const initialState: Settings = {
|
||||
androidHome: '/opt/android_sdk',
|
||||
androidHome:
|
||||
os.platform() == 'win32' ? getWindowsSdkPath() : '/opt/android_sdk',
|
||||
enableAndroid: true,
|
||||
enablePrefetching: Tristate.Unset,
|
||||
jsApps: {
|
||||
|
||||
Reference in New Issue
Block a user