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

Function updateFileMount

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

Source from the content-addressed store, hash-verified

309};
310
311export const updateFileMount = async (mountId: string) => {
312 const mount = await findMountById(mountId);
313 if (!mount || !mount.filePath) return;
314 const basePath = await getBaseFilesPath(mountId);
315 const fullPath = path.join(basePath, mount.filePath);
316
317 try {
318 const serverId = await getServerId(mount);
319 const encodedContent = encodeBase64(mount.content || "");
320 const command = `echo "${encodedContent}" | base64 -d > ${fullPath}`;
321 if (serverId) {
322 await execAsyncRemote(serverId, command);
323 } else {
324 await execAsync(command);
325 }
326 } catch {
327 console.log("Error updating file mount");
328 }
329};
330
331export const deleteFileMount = async (mountId: string) => {
332 const mount = await findMountById(mountId);

Callers 1

updateMountFunction · 0.85

Calls 6

encodeBase64Function · 0.90
execAsyncRemoteFunction · 0.90
execAsyncFunction · 0.90
findMountByIdFunction · 0.85
getBaseFilesPathFunction · 0.85
getServerIdFunction · 0.85

Tested by

no test coverage detected