(mountId: string)
| 309 | }; |
| 310 | |
| 311 | export 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 | |
| 331 | export const deleteFileMount = async (mountId: string) => { |
| 332 | const mount = await findMountById(mountId); |
no test coverage detected