Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit 8410103

Browse files
sebbasergiotomasello
authored andcommitted
Update uploader.js
Adding control in mode switching
1 parent b050e30 commit 8410103

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

node/compiler/uploader.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ exports.upload = function(upcmd,options, publish, callback) {
130130
console.log("doing a second list");
131131
//scan for ports again
132132
scanForPortReturn(list1, options, function(ppath) {
133-
//TODO : in upcmd search "-P"+options.port and substitute with "-P"+ppath
134-
upcmd[upcmd.indexOf("-P"+options.port)] = "-P"+ppath;
135-
//options.port = ppath;
133+
if(upcmd.indexOf("-P"+options.port)>-1)
134+
upcmd[upcmd.indexOf("-P"+options.port)] = "-P"+ppath;
135+
if(upcmd.indexOf("--port="+options.port)>-1)
136+
upcmd[upcmd.indexOf("--port="+options.port)] = "--port="+ppath;
136137
runAVRDude(upcmd, debug, callback);
137138
})
138139
},3000);
@@ -226,4 +227,4 @@ exports.writeBootloader = function(port, options){
226227
}
227228
}
228229
);
229-
}
230+
}

0 commit comments

Comments
 (0)