Skip to content

Commit 486bd92

Browse files
authored
Fix: writeBinaryFile to call the correct command (fix #1133) (#1136)
* Fix writeBinaryFile to call the correct command Fixes #1133 writeBinaryFile was reusing writeFile, which was happily saving base64 encoded strings to the fs. This instead uses the correct WriteBinaryFile command, which base64 decodes. However why are we encoding and then decoding, why can we not just send a raw byte array to be saved as a file? This is left for a later PR. * Shorten changelog line per review
1 parent 5810bae commit 486bd92

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changes/writeBinaryFile.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri.js": patch
3+
"tauri": minor
4+
---
5+
6+
Match writeBinaryFile command name between js and rust

cli/tauri.js/api-src/fs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ async function writeBinaryFile(
166166
}
167167

168168
return await promisified({
169-
cmd: 'writeFile',
169+
cmd: 'writeBinaryFile',
170170
path: file.path,
171171
contents: arrayBufferToBase64(file.contents),
172172
options

0 commit comments

Comments
 (0)