( path: string, sortOrder: string, plugin: TaskNotesPlugin )
| 543 | } |
| 544 | |
| 545 | async function writeSortOrder( |
| 546 | path: string, |
| 547 | sortOrder: string, |
| 548 | plugin: TaskNotesPlugin |
| 549 | ): Promise<void> { |
| 550 | const file = plugin.app.vault.getAbstractFileByPath(path); |
| 551 | if (!(file instanceof TFile)) return; |
| 552 | |
| 553 | const sortOrderField = plugin.settings.fieldMapping.sortOrder; |
| 554 | await plugin.app.fileManager.processFrontMatter(file, (frontmatter) => { |
| 555 | frontmatter[sortOrderField] = sortOrder; |
| 556 | }); |
| 557 | } |
| 558 | |
| 559 | /** |
| 560 | * Prepare a sort-order update plan without writing any files yet. |
no test coverage detected