Merge pull request #2126 from damellis/issue-1791

Proceed with upload even if port can't be found.
This commit is contained in:
Cristian Maglie 2014-06-13 11:33:20 +02:00
commit 65a4b4034d
3 changed files with 7 additions and 6 deletions

View File

@ -40,7 +40,7 @@ import processing.app.debug.TargetBoard;
public class UploaderAndMonitorFactory {
public Uploader newUploader(TargetBoard board, BoardPort port) {
if ("true".equals(board.getPreferences().get("upload.via_ssh")) && "network".equals(port.getProtocol())) {
if ("true".equals(board.getPreferences().get("upload.via_ssh")) && port != null && "network".equals(port.getProtocol())) {
return new SSHUploader(port);
}

View File

@ -121,6 +121,8 @@ public class SerialUploader extends Uploader {
String pattern = prefs.getOrExcept("upload.pattern");
String[] cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
uploadResult = executeUploadCommand(cmd);
} catch (RunnerException e) {
throw e;
} catch (Exception e) {
throw new RunnerException(e);
}
@ -228,6 +230,8 @@ public class SerialUploader extends Uploader {
String pattern = prefs.getOrExcept("program.pattern");
String[] cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
return executeUploadCommand(cmd);
} catch (RunnerException e) {
throw e;
} catch (Exception e) {
throw new RunnerException(e);
}
@ -287,6 +291,8 @@ public class SerialUploader extends Uploader {
pattern = prefs.getOrExcept("bootloader.pattern");
cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
return executeUploadCommand(cmd);
} catch (RunnerException e) {
throw e;
} catch (Exception e) {
throw new RunnerException(e);
}

View File

@ -1692,11 +1692,6 @@ public class Sketch {
BoardPort boardPort = Base.getDiscoveryManager().find(Preferences.get("serial.port"));
if (boardPort == null) {
editor.statusError(I18n.format("Board at {0} is not available", Preferences.get("serial.port")));
return false;
}
Uploader uploader = new UploaderAndMonitorFactory().newUploader(target.getBoards().get(board), boardPort);
boolean success = false;