From 252b0f3e1598cc7d369affa7b4e7ef98ec99095c Mon Sep 17 00:00:00 2001 From: lencx Date: Sun, 25 Dec 2022 08:53:58 +0800 Subject: [PATCH 1/2] fix: windows sync --- README-ZH_CN.md | 6 +++--- README.md | 6 +++--- UPDATE_LOG.md | 4 ++-- src-tauri/tauri.conf.json | 3 +-- src/utils.ts | 12 ++++++++++-- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/README-ZH_CN.md b/README-ZH_CN.md index 13b4d02..185ec87 100644 --- a/README-ZH_CN.md +++ b/README-ZH_CN.md @@ -22,9 +22,9 @@ **最新版:** -- `Mac`: [ChatGPT_0.6.9_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.6.9/ChatGPT_0.6.9_x64.dmg) -- `Linux`: [chat-gpt_0.6.9_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.6.9/chat-gpt_0.6.9_amd64.deb) -- `Windows`: [ChatGPT_0.6.9_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.6.9/ChatGPT_0.6.9_x64_en-US.msi) +- `Mac`: [ChatGPT_0.6.10_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.6.10/ChatGPT_0.6.10_x64.dmg) +- `Linux`: [chat-gpt_0.6.10_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.6.10/chat-gpt_0.6.10_amd64.deb) +- `Windows`: [ChatGPT_0.6.10_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.6.10/ChatGPT_0.6.10_x64_en-US.msi) [其他版本...](https://github.com/lencx/ChatGPT/releases) diff --git a/README.md b/README.md index 145733f..5fb48d4 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,9 @@ **Latest:** -- `Mac`: [ChatGPT_0.6.9_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.6.9/ChatGPT_0.6.9_x64.dmg) -- `Linux`: [chat-gpt_0.6.9_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.6.9/chat-gpt_0.6.9_amd64.deb) -- `Windows`: [ChatGPT_0.6.9_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.6.9/ChatGPT_0.6.9_x64_en-US.msi) +- `Mac`: [ChatGPT_0.6.10_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.6.10/ChatGPT_0.6.10_x64.dmg) +- `Linux`: [chat-gpt_0.6.10_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.6.10/chat-gpt_0.6.10_amd64.deb) +- `Windows`: [ChatGPT_0.6.10_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.6.10/ChatGPT_0.6.10_x64_en-US.msi) [Other version...](https://github.com/lencx/ChatGPT/releases) diff --git a/UPDATE_LOG.md b/UPDATE_LOG.md index 0ab1105..2c41c84 100644 --- a/UPDATE_LOG.md +++ b/UPDATE_LOG.md @@ -1,8 +1,8 @@ # UPDATE LOG -## v0.6.9 +## v0.6.10 -fix: unable to synchronize +fix: sync failure on windows ## v0.6.4 diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index aa9968d..5b1b5ad 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -22,8 +22,7 @@ "fs": { "all": true, "scope": [ - "$HOME/.chatgpt/**", - "$HOME/.chatgpt/cache_model/**" + "$HOME/.chatgpt/**" ] } }, diff --git a/src/utils.ts b/src/utils.ts index 5034cd8..e983604 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -28,7 +28,11 @@ type readJSONOpts = { defaultVal?: Record, isRoot?: boolean, isList export const readJSON = async (path: string, opts: readJSONOpts = {}) => { const { defaultVal = {}, isRoot = false, isList = false } = opts; const root = await chatRoot(); - const file = await join(isRoot ? '' : root, path); + let file = path; + + if (!isRoot) { + file = await join(root, path); + } if (!await exists(file)) { if (await dirname(file) !== root) { @@ -52,7 +56,11 @@ type writeJSONOpts = { dir?: string, isRoot?: boolean }; export const writeJSON = async (path: string, data: Record, opts: writeJSONOpts = {}) => { const { isRoot = false } = opts; const root = await chatRoot(); - const file = await join(isRoot ? '' : root, path); + let file = path; + + if (!isRoot) { + file = await join(root, path); + } if (isRoot && !await exists(await dirname(file))) { await createDir(await dirname(file), { recursive: true }); From 95a9f12b6818b5f9be8201f160a94c127f5fe8c2 Mon Sep 17 00:00:00 2001 From: lencx Date: Sun, 25 Dec 2022 08:54:11 +0800 Subject: [PATCH 2/2] v0.6.10 --- src-tauri/tauri.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 5b1b5ad..bd26562 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "ChatGPT", - "version": "0.6.9" + "version": "0.6.10" }, "tauri": { "allowlist": {