Skip to content

Commit d78a8a2

Browse files
Merge pull request #16 from NativeScript/vladimirov/fix-adb-check
Fix getting adb version when ANDROID_HOME is not set
2 parents 72a4417 + a209275 commit d78a8a2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/sys-info.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,12 @@ export class SysInfo implements NativeScriptDoctor.ISysInfo {
160160

161161
public getAdbVersion(): Promise<string> {
162162
return this.getValueForProperty(() => this.adbVerCache, async (): Promise<string> => {
163-
const output = await this.childProcess.spawnFromEvent(await this.androidToolsInfo.getPathToAdbFromAndroidHome(), ["version"], "close", { ignoreError: true });
163+
let output: IProcessInfo = null;
164+
const pathToAdbFromAndroidHome = await this.androidToolsInfo.getPathToAdbFromAndroidHome();
165+
if (pathToAdbFromAndroidHome) {
166+
output = await this.childProcess.spawnFromEvent(pathToAdbFromAndroidHome, ["version"], "close", { ignoreError: true });
167+
}
168+
164169
return output && output.stdout ? this.getVersionFromString(output.stdout) : null;
165170
});
166171
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-doctor",
3-
"version": "0.3.3",
3+
"version": "0.3.4",
44
"description": "Library that helps identifying if the environment can be used for development of {N} apps.",
55
"main": "lib/index.js",
66
"types": "./typings/nativescript-doctor.d.ts",

0 commit comments

Comments
 (0)