(historyPath: string, key: string, timestamp: number)
| 534 | } |
| 535 | |
| 536 | export const recordRecentCommand = async (historyPath: string, key: string, timestamp: number): Promise<void> => { |
| 537 | const recentCommands = await readRecentCommands(historyPath) |
| 538 | recentCommands[key] = timestamp |
| 539 | |
| 540 | const historyLines = Object.entries(recentCommands) |
| 541 | .sort((leftEntry, rightEntry) => leftEntry[1] - rightEntry[1]) |
| 542 | .map(([entryKey, entryTimestamp]) => `${entryKey}\t${entryTimestamp}`) |
| 543 | |
| 544 | await writeFile(historyPath, `${historyLines.join('\n')}\n`, 'utf8') |
| 545 | } |
| 546 | |
| 547 | export const buildMenuDisplayLabel = ( |
| 548 | command: CommandDefinition, |
no test coverage detected