( filePath: string, history: string[], )
| 57 | } |
| 58 | |
| 59 | async function writeHistoryFile( |
| 60 | filePath: string, |
| 61 | history: string[], |
| 62 | ): Promise<void> { |
| 63 | try { |
| 64 | await fs.mkdir(path.dirname(filePath), { recursive: true }); |
| 65 | await fs.writeFile(filePath, history.join('\n')); |
| 66 | } catch (error) { |
| 67 | console.error('Error writing shell history:', error); |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | export function useShellHistory(projectRoot: string): UseShellHistoryReturn { |
| 72 | const [history, setHistory] = useState<string[]>([]); |
no test coverage detected