| 613 | } |
| 614 | |
| 615 | function runStatus() { |
| 616 | const state = readState(); |
| 617 | |
| 618 | if (!state.lastScanCommit) { |
| 619 | console.log('[watch] No scans have been run yet.'); |
| 620 | process.exit(0); |
| 621 | } |
| 622 | |
| 623 | console.log('[watch] Current state:'); |
| 624 | console.log(` Last scan commit: ${state.lastScanCommit.slice(0, 7)}`); |
| 625 | console.log(` Scans run: ${state.stats.scansRun || 0}`); |
| 626 | console.log(` Markers found (total): ${state.stats.markersFound || 0}`); |
| 627 | console.log(` Intake items created (total): ${state.stats.intakeItemsCreated || 0}`); |
| 628 | |
| 629 | const pending = Object.values(state.pendingActions || {}); |
| 630 | if (pending.length > 0) { |
| 631 | console.log(` Pending actions: ${pending.length}`); |
| 632 | for (const a of pending) { |
| 633 | const desc = a.description ? ` ${a.description}` : ''; |
| 634 | console.log(` ${a.file}:${a.line} -- ${a.action}${desc}`); |
| 635 | } |
| 636 | } else { |
| 637 | console.log(' Pending actions: 0'); |
| 638 | } |
| 639 | |
| 640 | process.exit(0); |
| 641 | } |
| 642 | |
| 643 | function runReset() { |
| 644 | if (!acquireLock()) { |