@fuzzle/opencode-accountant 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17931,7 +17931,13 @@ function ensureYearJournalExists(directory, year) {
|
|
|
17931
17931
|
}
|
|
17932
17932
|
const mainJournalContent = fs7.readFileSync(mainJournalPath, "utf-8");
|
|
17933
17933
|
const includeDirective = `include ledger/${year}.journal`;
|
|
17934
|
-
|
|
17934
|
+
const lines = mainJournalContent.split(`
|
|
17935
|
+
`);
|
|
17936
|
+
const includeExists = lines.some((line) => {
|
|
17937
|
+
const trimmed = line.trim();
|
|
17938
|
+
return trimmed === includeDirective || trimmed.startsWith(includeDirective + " ");
|
|
17939
|
+
});
|
|
17940
|
+
if (!includeExists) {
|
|
17935
17941
|
const newContent = mainJournalContent.trimEnd() + `
|
|
17936
17942
|
` + includeDirective + `
|
|
17937
17943
|
`;
|