Skip to content

Commit 15e32c4

Browse files
committed
Don't add a trailing empty line each time a web app file is saved
1 parent fcca8bf commit 15e32c4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/commands/compile.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ async function importFile(
9696
if (typeof file.content === "string") {
9797
enc = false;
9898
content = file.content.split(/\r?\n/);
99+
100+
// Avoid appending a blank line on every save, which would cause a web app file to grow each time
101+
if (content.length > 1 && content[content.length - 1] === "") {
102+
content.pop();
103+
}
99104
} else {
100105
// Base64 encoding must be in chunk size multiple of 3 and within the server's potential 32K string limit
101106
// Output is 4 chars for each 3 input, so 24573/3*4 = 32764

0 commit comments

Comments
 (0)