mirror of
https://github.com/appium/appium.git
synced 2026-02-13 21:39:49 -06:00
windows compat fix in android binary finding logic (attempt to fix #1759)
This commit is contained in:
@@ -55,6 +55,7 @@ ADB.prototype.checkSdkBinaryPresent = function(binary, cb) {
|
||||
logger.info("Checking whether " + binary + " is present");
|
||||
var binaryLoc = null;
|
||||
var binaryName = binary;
|
||||
var cmd = "which";
|
||||
if (isWindows) {
|
||||
if (binaryName === "android") {
|
||||
binaryName += ".bat";
|
||||
@@ -63,6 +64,7 @@ ADB.prototype.checkSdkBinaryPresent = function(binary, cb) {
|
||||
binaryName += ".exe";
|
||||
}
|
||||
}
|
||||
cmd = "where";
|
||||
}
|
||||
if (this.sdkRoot) {
|
||||
var binaryLocs = [ path.resolve(this.sdkRoot, "platform-tools", binaryName)
|
||||
@@ -88,7 +90,7 @@ ADB.prototype.checkSdkBinaryPresent = function(binary, cb) {
|
||||
this.binaries[binary] = binaryLoc;
|
||||
cb(null, binaryLoc);
|
||||
} else {
|
||||
exec("which " + binary, { maxBuffer: 524288 }, function(err, stdout) {
|
||||
exec(cmd + " " + binary, { maxBuffer: 524288 }, function(err, stdout) {
|
||||
if (stdout) {
|
||||
this.debug("Using " + binary + " from " + stdout);
|
||||
cb(null, stdout);
|
||||
|
||||
Reference in New Issue
Block a user