MCPcopy Create free account
hub / github.com/VirtualHotBar/NetMount / mountStorage

Function mountStorage

src/controller/storage/mount/mount.ts:109–125  ·  view source on GitHub ↗
(mountInfo: MountListItem)

Source from the content-addressed store, hash-verified

107}
108
109async function mountStorage(mountInfo: MountListItem) {
110 if (
111 !rcloneInfo.version.os.toLowerCase().includes('windows') &&
112 !(await fs_exist_dir(mountInfo.mountPath))
113 ) {
114 await fs_make_dir(mountInfo.mountPath)
115 }
116
117 const back = await rclone_api_post('/mount/mount', {
118 fs: convertStoragePath(mountInfo.storageName) || mountInfo.storageName,
119 mountPoint: mountInfo.mountPath,
120 ...mountInfo.parameters,
121 })
122
123 await reupMount()
124 return back
125}
126
127async function unmountStorage(mountPath: string) {
128 await rclone_api_post('/mount/unmount', {

Callers 3

Mount_pageFunction · 0.90
AddMount_pageFunction · 0.90
autoMountFunction · 0.90

Calls 5

fs_exist_dirFunction · 0.90
fs_make_dirFunction · 0.90
rclone_api_postFunction · 0.90
convertStoragePathFunction · 0.90
reupMountFunction · 0.85

Tested by

no test coverage detected