Fix cordova/run not finding apk when multi-arch is specified but only arch-independent apk exists

This commit is contained in:
Andrew Grieve 2015-01-19 21:51:57 -05:00
parent d30a5e0388
commit 3ec7dfff8b

View File

@ -69,11 +69,13 @@ function findOutputApksHelper(dir, build_type, arch) {
if (ret.length === 0) { if (ret.length === 0) {
return ret; return ret;
} }
// Assume arch-specific build if newest api has -x86 or -arm.
var archSpecific = !!/-x86|-arm/.exec(ret[0]); var archSpecific = !!/-x86|-arm/.exec(ret[0]);
// And show only arch-specific ones (or non-arch-specific)
ret = ret.filter(function(p) { ret = ret.filter(function(p) {
return !!/-x86|-arm/.exec(p) == archSpecific; return !!/-x86|-arm/.exec(p) == archSpecific;
}); });
if (arch) { if (arch && ret.length > 1) {
ret = ret.filter(function(p) { ret = ret.filter(function(p) {
return p.indexOf('-' + arch) != -1; return p.indexOf('-' + arch) != -1;
}); });