MCPcopy Create free account
hub / github.com/anus-dev/ANUS / writeHistoryFile

Function writeHistoryFile

packages/cli/src/ui/hooks/useShellHistory.ts:59–69  ·  view source on GitHub ↗
(
  filePath: string,
  history: string[],
)

Source from the content-addressed store, hash-verified

57}
58
59async 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
71export function useShellHistory(projectRoot: string): UseShellHistoryReturn {
72 const [history, setHistory] = useState<string[]>([]);

Callers 1

useShellHistoryFunction · 0.85

Calls 1

mkdirMethod · 0.80

Tested by

no test coverage detected