MCPcopy
hub / github.com/marktext/marktext / addDir

Function addDir

packages/desktop/src/main/filesystem/watcher.ts:150–168  ·  view source on GitHub ↗
(win: BrowserWindow, pathname: string, type: WatchType)

Source from the content-addressed store, hash-verified

148}
149
150const addDir = (win: BrowserWindow, pathname: string, type: WatchType): void => {
151 if (type === 'file') return
152
153 const directory = {
154 pathname,
155 name: path.basename(pathname),
156 isCollapsed: true,
157 isDirectory: true,
158 isFile: false,
159 isMarkdown: false,
160 folders: [],
161 files: []
162 }
163
164 win.webContents.send('mt::update-object-tree', {
165 type: 'addDir',
166 change: directory
167 })
168}
169
170const unlinkDir = (win: BrowserWindow, pathname: string, type: WatchType): void => {
171 if (type === 'file') return

Callers 1

watchMethod · 0.85

Calls 2

basenameMethod · 0.80
sendMethod · 0.80

Tested by

no test coverage detected