(context: ScanContext)
| 504 | } |
| 505 | |
| 506 | function scanCode(context: ScanContext): void { |
| 507 | const paths = getPaths(getVaultPath()) |
| 508 | const records: EntityScanRecord[] = [] |
| 509 | const skipRootNames = new Set([META_DIR_NAME, 'inbox', TRASH_DIR_NAME]) |
| 510 | |
| 511 | listFolders(paths.vaultPath, skipRootNames).forEach((folderPath) => { |
| 512 | const metaPath = path.join(paths.vaultPath, folderPath, META_FILE_NAME) |
| 513 | if (!fs.pathExistsSync(metaPath)) { |
| 514 | addItem( |
| 515 | context, |
| 516 | createFileItem({ |
| 517 | action: 'create-folder-metadata', |
| 518 | absolutePath: path.join(paths.vaultPath, folderPath), |
| 519 | kind: 'folder', |
| 520 | relativePath: folderPath, |
| 521 | space: 'code', |
| 522 | status: 'pending', |
| 523 | }), |
| 524 | ) |
| 525 | } |
| 526 | }) |
| 527 | |
| 528 | listMarkdownFiles(paths.vaultPath).forEach((filePath) => { |
| 529 | const record = inspectMarkdownEntity({ |
| 530 | context, |
| 531 | filePath, |
| 532 | kind: 'snippet', |
| 533 | rootPath: paths.vaultPath, |
| 534 | space: 'code', |
| 535 | }) |
| 536 | if (record) { |
| 537 | records.push(record) |
| 538 | } |
| 539 | }) |
| 540 | |
| 541 | collectDuplicateIds(context, records) |
| 542 | } |
| 543 | |
| 544 | function scanNotes(context: ScanContext): void { |
| 545 | const paths = getNotesPaths(getVaultPath()) |
no test coverage detected