MCPcopy
hub / github.com/desktop/desktop / getLogFilesIn

Function getLogFilesIn

app/src/main-process/desktop-file-transport.ts:84–87  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

82const getFilePrefix = (d = new Date()) => d.toISOString().split('T', 1)[0]
83const getFilePath = (p: string) => join(p, `${getFilePrefix()}${fileSuffix}`)
84const getLogFilesIn = (p: string) =>
85 readdir(p, { withFileTypes: true })
86 .then(entries => entries.filter(x => x.isFile() && pathRe.test(x.name)))
87 .catch(error('readdir'))
88
89const pruneDirectory = async (p: string) => {
90 const all = await getLogFilesIn(p)

Callers 1

pruneDirectoryFunction · 0.85

Calls 2

errorFunction · 0.70
filterMethod · 0.65

Tested by

no test coverage detected