windows mount issue #138

This commit is contained in:
FTCHD
2026-01-30 01:23:48 +07:00
parent b38d96c68b
commit 7391214be5
2 changed files with 14 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import { sep } from '@tauri-apps/api/path' import { sep } from '@tauri-apps/api/path'
const RE_WINDOWS_DRIVE = /^[a-zA-Z]:[/\\]/ const RE_WINDOWS_DRIVE = /^[a-zA-Z]:([/\\]|$)/
const RE_WINDOWS_DRIVE_WITH_SLASH = /^([a-zA-Z]:)\/?/ const RE_WINDOWS_DRIVE_WITH_SLASH = /^([a-zA-Z]:)\/?/
const RE_LOCAL_WINDOWS_PATH = /^:local:([a-zA-Z]:\/?.*)$/ const RE_LOCAL_WINDOWS_PATH = /^:local:([a-zA-Z]:\/?.*)$/
const RE_PATH_SEPARATOR = /[/\\]/ const RE_PATH_SEPARATOR = /[/\\]/
+13 -4
View File
@@ -595,6 +595,7 @@ export async function startMount({
retries: 3, retries: 3,
} }
) )
return
} }
const { const {
@@ -715,10 +716,18 @@ export async function startMount({
global: mergedOptions, global: mergedOptions,
remote: srcOptions, remote: srcOptions,
}), }),
mountPoint: mountPoint: (() => {
platform() === 'windows' if (platform() !== 'windows') {
? dstFullDirPath.replace(':local:', '').replace(RE_BACKSLASH, '/') return dstFullDirPath.replace(':local:', '/')
: dstFullDirPath.replace(':local:', '/'), }
const mp = dstFullDirPath
.replace(':local:', '')
.replace(RE_BACKSLASH, '/')
if (/^[a-zA-Z]:\/$/.test(mp)) {
return mp.slice(0, -1)
}
return mp
})(),
mount: 'nfsmount', mount: 'nfsmount',
}, },
}, },