diff --git a/electron-builder.yml b/electron-builder.yml index 0241cd779..215d538e9 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -62,7 +62,4 @@ electronDownload: afterSign: scripts/notarize.js releaseInfo: releaseNotes: | - 修复对话消息无法删除问题 - 支持 Gemini 模型联网搜索 - 发送消息增加 Command + Enter 快捷键 by @duanyongcheng - Windows 版本样式优化 + 修复部分场景下应用崩溃问题 diff --git a/package.json b/package.json index 5f3591905..ea8312e0b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "CherryStudio", - "version": "0.8.25", + "version": "0.8.26", "private": true, "description": "A powerful AI assistant for producer.", "main": "./out/main/index.js", @@ -76,7 +76,7 @@ "dexie": "^4.0.8", "dexie-react-hooks": "^1.1.7", "dotenv-cli": "^7.4.2", - "electron": "^33.2.1", + "electron": "31.7.6", "electron-builder": "^24.13.3", "electron-devtools-installer": "^3.2.0", "electron-icon-builder": "^2.0.1", diff --git a/scripts/replaceSpaces.js b/scripts/replaceSpaces.js index 6e593387e..80009e0d9 100644 --- a/scripts/replaceSpaces.js +++ b/scripts/replaceSpaces.js @@ -5,22 +5,54 @@ const path = require('path') const directory = 'dist' -fs.readdir(directory, (err, files) => { - if (err) throw err +// 处理文件名中的空格 +function replaceFileNames() { + fs.readdir(directory, (err, files) => { + if (err) throw err - files.forEach((file) => { - const oldPath = path.join(directory, file) - const newPath = path.join(directory, file.replace(/ /g, '-')) + files.forEach((file) => { + const oldPath = path.join(directory, file) + const newPath = path.join(directory, file.replace(/ /g, '-')) - fs.stat(oldPath, (err, stats) => { - if (err) throw err + fs.stat(oldPath, (err, stats) => { + if (err) throw err - if (stats.isFile() && oldPath !== newPath) { - fs.rename(oldPath, newPath, (err) => { + if (stats.isFile() && oldPath !== newPath) { + fs.rename(oldPath, newPath, (err) => { + if (err) throw err + console.log(`Renamed: ${oldPath} -> ${newPath}`) + }) + } + }) + }) + }) +} + +function replaceYmlContent() { + fs.readdir(directory, (err, files) => { + if (err) throw err + + files.forEach((file) => { + if (path.extname(file).toLowerCase() === '.yml') { + const filePath = path.join(directory, file) + + fs.readFile(filePath, 'utf8', (err, data) => { if (err) throw err - console.log(`Renamed: ${oldPath} -> ${newPath}`) + + // 替换内容 + const newContent = data.replace(/Cherry Studio-/g, 'Cherry-Studio-') + + // 写回文件 + fs.writeFile(filePath, newContent, 'utf8', (err) => { + if (err) throw err + console.log(`Updated content in: ${filePath}`) + }) }) } }) }) -}) +} + +// 执行两个操作 +replaceFileNames() +replaceYmlContent() diff --git a/yarn.lock b/yarn.lock index 808af03e1..6aa7dd4f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2355,7 +2355,7 @@ __metadata: dexie-react-hooks: "npm:^1.1.7" docx: "npm:^9.0.2" dotenv-cli: "npm:^7.4.2" - electron: "npm:^33.2.1" + electron: "npm:31.7.6" electron-builder: "npm:^24.13.3" electron-devtools-installer: "npm:^3.2.0" electron-icon-builder: "npm:^2.0.1" @@ -4452,16 +4452,16 @@ __metadata: languageName: node linkType: hard -"electron@npm:^33.2.1": - version: 33.3.0 - resolution: "electron@npm:33.3.0" +"electron@npm:31.7.6": + version: 31.7.6 + resolution: "electron@npm:31.7.6" dependencies: "@electron/get": "npm:^2.0.0" "@types/node": "npm:^20.9.0" extract-zip: "npm:^2.0.1" bin: electron: cli.js - checksum: 10c0/ce381fb63da60b52b131aea473568aad2bff58cc3d8fd6fc68b4d0c0d5485e381e1a576727477ce901f4bd017baaa9e66f3f04da6ff698229343193258a8d38e + checksum: 10c0/4b7ee31894eb3606d6a6047cd7af22d3b82331dacb96869c483bfd32ffc8581ef638ccfa027938d83d5242e7bf8b7856cad29a09fb80942a25ef3de0c888fb48 languageName: node linkType: hard