Commit 01a56a9
committed
fix(web-host): fix
The `Descriptor#write` method was incorrectly trying to preserve existing file content
when writing, which broke the `tee` command's ability to overwrite files.
The fix simplifies the logic: instead of concatenating new data with existing file
content, the method now directly replaces the file's buffer. This matches the expected
behavior of file writes - when writing to a file, it should overwrite the content,
not append to it.
- Remove buffer concatenation logic in writeViaStream
- Implement direct buffer replacement for proper file overwriting
- Fixes tee command behavior on both new and existing files
Issue: #12tee command file overwriting behavior #12
1 parent ce56bee commit 01a56a9
File tree
1 file changed
+3
-4
lines changed- packages/web-host/overrides/@bytecodealliance/preview2-shim/lib/browser
1 file changed
+3
-4
lines changedLines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
| 113 | + | |
| 114 | + | |
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
| |||
196 | 195 | | |
197 | 196 | | |
198 | 197 | | |
199 | | - | |
| 198 | + | |
200 | 199 | | |
201 | 200 | | |
202 | 201 | | |
| |||
0 commit comments