Skip to content

Commit

Permalink
Handle 'iPad Pro (12.9 inch) (C0F6C6F5-80EA-497C-86AD-02A5176E1D30) (…
Browse files Browse the repository at this point in the history
…Shutdown)'
  • Loading branch information
aharbick committed Oct 8, 2016
1 parent 34426c7 commit 37028f9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/simctl-list-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,18 @@ function parseDevice(line) {
// the last capture group might not be there if available

var available = false;
var regExp = /(.*)\(([^)]+)\)\s\(([^)]+)\)\s\(([^)]+)\)/;

var regExp = /(.*)\(([A-Z0-9\-]+)\)\s\(([^)]+)\)\s\(([^)]+)\)/;
var matches = regExp.exec(line);
if (!matches) {
regExp = /(.*)\(([^)]+)\)\s\(([^)]+)\)/;
regExp = /(.*)\(([A-Z0-9\-]+)\)\s\(([^)]+)\)/;
matches = regExp.exec(line);
available = true;
}

if (matches) {
var obj = {
'name' : matches[1].trim(),
'name' : matches[1].replace(/\-/g, ' ').trim(),
'id' : matches[2].trim(),
'state' : matches[3].trim(),
'available' : available
Expand Down Expand Up @@ -162,7 +162,7 @@ function parseDeviceType(line) {

if (matches) {
var obj = {
'name' : matches[1].trim(),
'name' : matches[1].replace(/\-/g, ' ').trim(),
'id' : matches[2].trim()
};

Expand Down

0 comments on commit 37028f9

Please sign in to comment.