Skip to content

Commit 1a5eea9

Browse files
committed
Allow pretokenised code to be written to hex files
1 parent 31bd1c0 commit 1a5eea9

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

bin/espruino-cli.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ function setupConfig(Espruino, callback) {
290290
if (args.remotePeerID) { // Remote connection enabled
291291
if (!Espruino.Core.RemoteConnection)
292292
throw new Error("WebRTC not loaded - run again with --verbose for more info");
293-
Espruino.Config.set("WEBRTC_BRIDGE_ID", args.remotePeerID);
294-
}
293+
Espruino.Config.set("WEBRTC_BRIDGE_ID", args.remotePeerID);
294+
}
295295
if (args.board) {
296296
log("Explicit board JSON supplied: "+JSON.stringify(args.board));
297297
var jsonLoaded = function(json) {
@@ -457,7 +457,9 @@ function sendCode(callback) {
457457
log("* with '-p devicePath' or use '--board BOARDNAME' *");
458458
log("********************************************************************");
459459
}
460-
if (!args.outputHEX) {
460+
if (args.outputHEX) {
461+
Espruino.Config.SAVE_ON_SEND = -1; // force tools not to mess with the file
462+
} else {
461463
// if we're supposed to upload code somewhere ensure we do that properly
462464
if (args.outputJS)
463465
Espruino.Config.SAVE_ON_SEND = -1; // force tools not to mess with the file
@@ -776,10 +778,10 @@ function getPortPath(port, callback) {
776778
var timeout = args.scanTimeout * 2;
777779
Espruino.Core.Serial.getPorts(function cb(ports, shouldCallAgain) {
778780
//log(JSON.stringify(ports,null,2));
779-
var found = ports.find(function(p) {
780-
return (p.description && p.description.toLowerCase().indexOf(searchString)>=0) ||
781+
var found = ports.find(function(p) {
782+
return (p.description && p.description.toLowerCase().indexOf(searchString)>=0) ||
781783
(p.path && p.path.toLowerCase().indexOf(searchString)>=0) ||
782-
p.autoconnect;
784+
p.autoconnect;
783785
});
784786
if (found) {
785787
log("Found "+JSON.stringify(found.description)+" ("+JSON.stringify(found.path)+")");

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "espruino",
3-
"version": "0.1.56",
3+
"version": "0.1.57",
44
"description": "Command Line Interface and library for Communications with Espruino JavaScript Microcontrollers",
55
"main": "index.js",
66
"files": [

0 commit comments

Comments
 (0)