()
| 649 | } |
| 650 | |
| 651 | const printRecentCommands = async (): Promise<void> => { |
| 652 | const recentCommands = await readRecentCommands() |
| 653 | const orderedEntries = Object.entries(recentCommands).sort((leftEntry, rightEntry) => rightEntry[1] - leftEntry[1]) |
| 654 | |
| 655 | if (orderedEntries.length === 0) { |
| 656 | console.log('No recent commands recorded.') |
| 657 | return |
| 658 | } |
| 659 | |
| 660 | for (const [key, timestamp] of orderedEntries) { |
| 661 | const command = getCommandByKey(key) |
| 662 | |
| 663 | if (!command) { |
| 664 | continue |
| 665 | } |
| 666 | |
| 667 | console.log([new Date(timestamp).toLocaleString(), command.category, command.name, command.command].join('\t')) |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | const printAvailableTargets = (): void => { |
| 672 | console.error('Unknown make command target.') |
no test coverage detected