From a7da5cfe3affc7de836f9d68119f72c60cf6a86f Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 3 Oct 2024 13:03:28 +0100 Subject: [PATCH] executeStatement prepends other code onto the command, so don't add `\x10` at the start of line as then it just ends up in the middle of what's sent --- core/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/utils.js b/core/utils.js index 59d35fa..df5903f 100644 --- a/core/utils.js +++ b/core/utils.js @@ -450,7 +450,8 @@ while (d!==undefined) {console.log(btoa(d));d=f.read(${CHUNKSIZE});} // Upload a file function uploadFile(fileName, contents, callback) { - var js = "\x10"+getUploadFileCode(fileName, contents).replace(/\n/g,"\n\x10"); + var js = getUploadFileCode(fileName, contents).replace(/\n/g,"\n\x10"); + // executeStatement prepends other code onto the command, so don't add `\x10` at the start of line as then it just ends up in the middle of what's sent Espruino.Core.Utils.executeStatement(js, callback); }