From aa2b3d3da1f2471ec1211ef82082c3c9cd399272 Mon Sep 17 00:00:00 2001 From: daserge Date: Fri, 26 Feb 2016 13:14:42 +0300 Subject: [PATCH] CB-10669 cordova run --list cannot find 'adb' --- bin/templates/cordova/lib/list-devices | 15 ++++++++------- bin/templates/cordova/lib/list-emulator-images | 14 ++++++++------ bin/templates/cordova/lib/list-started-emulators | 14 ++++++++------ 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/bin/templates/cordova/lib/list-devices b/bin/templates/cordova/lib/list-devices index e390bff6..fa84d7f6 100755 --- a/bin/templates/cordova/lib/list-devices +++ b/bin/templates/cordova/lib/list-devices @@ -22,12 +22,13 @@ var devices = require('./device'); // Usage support for when args are given -devices.list().done(function(device_list) { - device_list && device_list.forEach(function(dev) { - console.log(dev); +require('../lib/check_reqs').check_android().then(function() { + devices.list().done(function(device_list) { + device_list && device_list.forEach(function(dev) { + console.log(dev); + }); + }, function(err) { + console.error('ERROR: ' + err); + process.exit(2); }); -}, function(err) { - console.error('ERROR: ' + err); - process.exit(2); }); - diff --git a/bin/templates/cordova/lib/list-emulator-images b/bin/templates/cordova/lib/list-emulator-images index 996cf555..03c827fe 100755 --- a/bin/templates/cordova/lib/list-emulator-images +++ b/bin/templates/cordova/lib/list-emulator-images @@ -22,11 +22,13 @@ var emulators = require('./emulator'); // Usage support for when args are given -emulators.list_images().done(function(emulator_list) { - emulator_list && emulator_list.forEach(function(emu) { - console.log(emu.name); +require('../lib/check_reqs').check_android().then(function() { + emulators.list_images().done(function(emulator_list) { + emulator_list && emulator_list.forEach(function(emu) { + console.log(emu.name); + }); + }, function(err) { + console.error('ERROR: ' + err); + process.exit(2); }); -}, function(err) { - console.error('ERROR: ' + err); - process.exit(2); }); diff --git a/bin/templates/cordova/lib/list-started-emulators b/bin/templates/cordova/lib/list-started-emulators index 2ae8c5a8..a890dec6 100755 --- a/bin/templates/cordova/lib/list-started-emulators +++ b/bin/templates/cordova/lib/list-started-emulators @@ -22,11 +22,13 @@ var emulators = require('./emulator'); // Usage support for when args are given -emulators.list_started().done(function(emulator_list) { - emulator_list && emulator_list.forEach(function(emu) { - console.log(emu); +require('../lib/check_reqs').check_android().then(function() { + emulators.list_started().done(function(emulator_list) { + emulator_list && emulator_list.forEach(function(emu) { + console.log(emu); + }); + }, function(err) { + console.error('ERROR: ' + err); + process.exit(2); }); -}, function(err) { - console.error('ERROR: ' + err); - process.exit(2); });