From f2f60cf9fe58713acd2acb006f8a411c1e6f8cf7 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 17 Mar 2023 11:08:16 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BD=BF=E7=94=A8=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=90=8C=E6=AD=A5=E7=9B=98=E6=97=B6=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=B9=B6=E9=80=80=E5=87=BA=E5=86=85=E6=A0=B8?= =?UTF-8?q?=20https://github.com/siyuan-note/siyuan/issues/7683?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/electron/init.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/electron/init.html b/app/electron/init.html index 144e6de47..ea02837a4 100644 --- a/app/electron/init.html +++ b/app/electron/init.html @@ -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") + }