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'
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_LOCAL_WINDOWS_PATH = /^:local:([a-zA-Z]:\/?.*)$/
const RE_PATH_SEPARATOR = /[/\\]/
+13 -4
View File
@@ -595,6 +595,7 @@ export async function startMount({
retries: 3,
}
)
return
}
const {
@@ -715,10 +716,18 @@ export async function startMount({
global: mergedOptions,
remote: srcOptions,
}),
mountPoint:
platform() === 'windows'
? dstFullDirPath.replace(':local:', '').replace(RE_BACKSLASH, '/')
: dstFullDirPath.replace(':local:', '/'),
mountPoint: (() => {
if (platform() !== 'windows') {
return 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',
},
},