code: function getPortPath(port, callback) {
    if (port.type=="path") callback(port.name);
    else if (port.type=="name") {
      log("Searching for device named "+JSON.stringify(port.name));
      var searchString = port.name.toLowerCase();
      var timeout = 2;
      Espruino.Core.Serial.getPorts(function cb(ports, shouldCallAgain) {
        //log(JSON.stringify(ports,null,2));
        var found = ports.find(function(p) { return p.description && p.description.toLowerCase().indexOf(searchString)>=0; });
        if (found) {
          log("Found "+JSON.stringify(found.description)+" ("+JSON.stringify(found.path)+")");
          callback(found.path);
        } else {
          if (timeout-- > 0 && shouldCallAgain) // try again - sometimes BLE devices take a while
            Espruino.Core.Serial.getPorts(cb);
          else {
           log("Port named "+JSON.stringify(port.name)+" not found");
           process.exit(1);
         }
        }
      });
    } else throw new Error("Unknown port type! "+JSON.stringify(port));
  }
docs: /* If the user's asked us to find a device by name, list
  all devices and search