Don't remove empty lines in shell startup scripts. Fixes #58

This commit is contained in:
Sander Declerck 2025-09-17 16:42:10 +02:00
parent 846c62e4e0
commit 57ce17e7f5
No known key found for this signature in database
2 changed files with 27 additions and 3 deletions

View file

@ -222,5 +222,24 @@ describe("Zsh shell integration", () => {
);
assert.ok(content.includes("alias ls="));
});
it("should respect empty lines and comments", () => {
const initialContent = [
"#!/bin/zsh",
"",
"# Some comment",
"",
"",
"",
"# Another comment",
].join("\n");
fs.writeFileSync(mockStartupFile, initialContent, "utf-8");
zsh.teardown(knownAikidoTools);
const content = fs.readFileSync(mockStartupFile, "utf-8");
assert.strictEqual(content, initialContent);
});
});
});