(mountId: string)
| 329 | }; |
| 330 | |
| 331 | export 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 | |
| 348 | export const getBaseFilesPath = async (mountId: string) => { |
| 349 | const mount = await findMountById(mountId); |
no test coverage detected