Switch to using settings for android sdk location

Summary: A settings screen has been added where android home can be set. This changes the downstream code to use this value rather than the `env.PATH` variable.

Reviewed By: passy

Differential Revision: D17713288

fbshipit-source-id: 51551652c9c2f468e1117c18785123348e4b4576
This commit is contained in:
John Knox
2019-10-07 08:49:05 -07:00
committed by Facebook Github Bot
parent 85c0ec0d13
commit 729e74f2fc
11 changed files with 72 additions and 44 deletions

View File

@@ -11,8 +11,10 @@ import {
_push,
_pull,
} from './androidContainerUtilityInternal';
import {Client} from 'adbkit';
export function push(
client: Client,
deviceId: string,
app: string,
filepath: string,
@@ -21,20 +23,21 @@ export function push(
return validateAppName(app).then(validApp =>
validateFilePath(filepath).then(validFilepath =>
validateFileContent(contents).then(validContent =>
_push(deviceId, validApp, validFilepath, validContent),
_push(client, deviceId, validApp, validFilepath, validContent),
),
),
);
}
export function pull(
client: Client,
deviceId: string,
app: string,
path: string,
): Promise<string> {
return validateAppName(app).then(validApp =>
validateFilePath(path).then(validPath =>
_pull(deviceId, validApp, validPath),
_pull(client, deviceId, validApp, validPath),
),
);
}