Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-23484] wptool.detect() ignore errors when results are present #48

Merged
merged 2 commits into from
Jul 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.4.14 (6/24/2016)
-------------------
* [TIMOB-23484] wptool.detect() ignore errors when results are present

0.4.13 (4/29/2016)
-------------------
* Fix [TIMOB-20376] Windows Phone: Cannot read property 'split' of undefined
Expand Down
9 changes: 6 additions & 3 deletions lib/wptool.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ function detect(options, callback) {
},
tmp = {};

if (!err) {
if (err && !results) {
// detected an error with no results
callback(err);
} else {
Object.keys(results).forEach(function (wpsdk) {
result.emulators[wpsdk] = results[wpsdk].emulators;
results[wpsdk].devices.forEach(function (dev) {
Expand Down Expand Up @@ -320,7 +323,7 @@ function detect(options, callback) {
}
}

callback(err, result);
callback(null, result);
});
}

Expand Down Expand Up @@ -379,7 +382,7 @@ function enumerate(options, callback) {
return results[wpsdk].emulators.length > 0;
})) {
emitter.emit('error', errors[0]);
return callback(errors[0]);
return callback(errors[0], results);
}

// add a helper function to get a device by udid
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "windowslib",
"version": "0.4.13",
"version": "0.4.14",
"description": "Windows Phone Utility Library",
"keywords": [
"appcelerator",
Expand Down