mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-13 10:29:35 +01:00
Merge pull request #2126 from damellis/issue-1791
Proceed with upload even if port can't be found.
This commit is contained in:
commit
65a4b4034d
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user