Skip to content

Commit

Permalink
Allow pretokenised code to be written to hex files
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Sep 30, 2024
1 parent 31bd1c0 commit 1a5eea9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions bin/espruino-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ function setupConfig(Espruino, callback) {
if (args.remotePeerID) { // Remote connection enabled
if (!Espruino.Core.RemoteConnection)
throw new Error("WebRTC not loaded - run again with --verbose for more info");
Espruino.Config.set("WEBRTC_BRIDGE_ID", args.remotePeerID);
}
Espruino.Config.set("WEBRTC_BRIDGE_ID", args.remotePeerID);
}
if (args.board) {
log("Explicit board JSON supplied: "+JSON.stringify(args.board));
var jsonLoaded = function(json) {
Expand Down Expand Up @@ -457,7 +457,9 @@ function sendCode(callback) {
log("* with '-p devicePath' or use '--board BOARDNAME' *");
log("********************************************************************");
}
if (!args.outputHEX) {
if (args.outputHEX) {
Espruino.Config.SAVE_ON_SEND = -1; // force tools not to mess with the file
} else {
// if we're supposed to upload code somewhere ensure we do that properly
if (args.outputJS)
Espruino.Config.SAVE_ON_SEND = -1; // force tools not to mess with the file
Expand Down Expand Up @@ -776,10 +778,10 @@ function getPortPath(port, callback) {
var timeout = args.scanTimeout * 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) ||
var found = ports.find(function(p) {
return (p.description && p.description.toLowerCase().indexOf(searchString)>=0) ||
(p.path && p.path.toLowerCase().indexOf(searchString)>=0) ||
p.autoconnect;
p.autoconnect;
});
if (found) {
log("Found "+JSON.stringify(found.description)+" ("+JSON.stringify(found.path)+")");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "espruino",
"version": "0.1.56",
"version": "0.1.57",
"description": "Command Line Interface and library for Communications with Espruino JavaScript Microcontrollers",
"main": "index.js",
"files": [
Expand Down

0 comments on commit 1a5eea9

Please sign in to comment.