MCPcopy
hub / github.com/Dokploy/dokploy / deleteFileMount

Function deleteFileMount

packages/server/src/services/mount.ts:331–346  ·  view source on GitHub ↗
(mountId: string)

Source from the content-addressed store, hash-verified

329};
330
331export const deleteFileMount = async (mountId: string) => {
332 const mount = await findMountById(mountId);
333 if (!mount.filePath) return;
334 const basePath = await getBaseFilesPath(mountId);
335
336 const fullPath = path.join(basePath, mount.filePath);
337 try {
338 const serverId = await getServerId(mount);
339 if (serverId) {
340 const command = `rm -rf ${fullPath}`;
341 await execAsyncRemote(serverId, command);
342 } else {
343 await removeFileOrDirectory(fullPath);
344 }
345 } catch {}
346};
347
348export const getBaseFilesPath = async (mountId: string) => {
349 const mount = await findMountById(mountId);

Callers 1

deleteMountFunction · 0.85

Calls 5

execAsyncRemoteFunction · 0.90
removeFileOrDirectoryFunction · 0.90
findMountByIdFunction · 0.85
getBaseFilesPathFunction · 0.85
getServerIdFunction · 0.85

Tested by

no test coverage detected