mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-31 22:08:48 +01:00
🎨 使用第三方同步盘时弹出提示并退出内核 https://github.com/siyuan-note/siyuan/issues/7683
This commit is contained in:
parent
df3ee3f24e
commit
f2f60cf9fe
1 changed files with 11 additions and 0 deletions
|
|
@ -355,6 +355,11 @@
|
|||
const {ipcRenderer} = require('electron')
|
||||
const fs = require('fs')
|
||||
const initPath = result.filePaths[0]
|
||||
if (isCloudDrivePath(initPath)) {
|
||||
alert('⚠️ This folder may be a cloud sync disk folder, please change to a local folder')
|
||||
return
|
||||
}
|
||||
|
||||
if (!fs.existsSync(initPath)) {
|
||||
fs.mkdirSync(initPath, {mode: 0o755, recursive: true})
|
||||
}
|
||||
|
|
@ -366,6 +371,12 @@
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
const isCloudDrivePath = (absPath) => {
|
||||
const absPathLower = absPath.toLowerCase()
|
||||
return -1 < absPathLower.indexOf("onedrive") || -1 < absPathLower.indexOf("dropbox") ||
|
||||
-1 < absPathLower.indexOf("google drive") || -1 < absPathLower.indexOf("pcloud")
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue