Skip to content

Commit

Permalink
Fix `Failed to execute 'getWriter' on 'WritableStream': Cannot create…
Browse files Browse the repository at this point in the history
… writer when WritableStream is locked` error
  • Loading branch information
gfwilliams committed Sep 20, 2024
1 parent d337f26 commit b0aa56d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/uartUploadZIP.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
// If the path ends with a slash, it's a directory, which we should create if it doesn't exist
if (path[path.length-1]=="/") {
console.log("Creating directory "+path);
UART.getConnection().write(`\x10if (!require("fs").statSync(${JSON.stringify(path)})) require("fs").mkdir(${JSON.stringify(path)});\n`);
return new Promise(resolve =>
UART.getConnection().write(`\x10if (!require("fs").statSync(${JSON.stringify(path)})) require("fs").mkdir(${JSON.stringify(path)});\n`, resolve));
} else {
console.log("Can't restore files of length 0, ignoring "+path);
}
Expand Down

0 comments on commit b0aa56d

Please sign in to comment.