MCPcopy Create free account
hub / github.com/ZingerLittleBee/ServerBee / printRecentCommands

Function printRecentCommands

scripts/make-menu.ts:651–669  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

649}
650
651const 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
671const printAvailableTargets = (): void => {
672 console.error('Unknown make command target.')

Callers 1

mainFunction · 0.85

Calls 3

readRecentCommandsFunction · 0.85
getCommandByKeyFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected