From 30fd11cbcd2cc0ba30618adc16d916f6b36b369e Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 17 Aug 2022 11:45:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:art:=20=E6=AF=8F=E6=AC=A1=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E7=A8=8B=E5=BA=8F=E4=B8=8D=E5=86=8D=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=20Documents=20=E6=96=87=E4=BB=B6=E5=A4=B9=20?= =?UTF-8?q?Fix=20https://github.com/siyuan-note/siyuan/issues/5653?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/electron/main.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/electron/main.js b/app/electron/main.js index eb0ae9fe0..46d61f7dc 100644 --- a/app/electron/main.js +++ b/app/electron/main.js @@ -82,10 +82,6 @@ try { if (!fs.existsSync(confDir)) { fs.mkdirSync(confDir, {mode: 0o755, recursive: true}) } - const documents = path.join(app.getPath('home'), 'Documents') - if (!fs.existsSync(documents)) { - fs.mkdirSync(documents, {mode: 0o755, recursive: true}) - } } catch (e) { console.error(e) require('electron').dialog.showErrorBox('创建配置目录失败 Failed to create config directory', From ae8b83c53e9b634292f344f94bdb5ff2ca664250 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 17 Aug 2022 17:19:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?:art:=20=E6=94=B9=E8=BF=9B=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=A8=A1=E6=9D=BF=E6=97=B6=20`/=E6=A8=A1=E6=9D=BF`=20?= =?UTF-8?q?=E7=9A=84=E4=BA=A4=E4=BA=92=20https://github.com/siyuan-note/si?= =?UTF-8?q?yuan/issues/5636?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/template.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/model/template.go b/kernel/model/template.go index 7b796412b..1dddfe955 100644 --- a/kernel/model/template.go +++ b/kernel/model/template.go @@ -59,6 +59,8 @@ func RenderCreateDocNameTemplate(nameTemplate string) (ret string, err error) { } func SearchTemplate(keyword string) (ret []*Block) { + ret = []*Block{} + templates := filepath.Join(util.DataDir, "templates") k := strings.ToLower(keyword) filepath.Walk(templates, func(path string, info fs.FileInfo, err error) error {