windows mount issue #138
This commit is contained in:
+1
-1
@@ -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
@@ -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',
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user