Skip to content

Commit

Permalink
fix: 🔧 修复 macOS 无法正确获取系统依赖路径的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Oct 20, 2023
1 parent d4f064c commit 2352593
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
- name: release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: true
files: |
dist-release/*.exe
dist-release/*.zip
Expand Down
5 changes: 5 additions & 0 deletions electron/helpers/process.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
/** 在主进程中获取关键信息存储到环境变量中,从而在预加载脚本中及渲染进程中使用 */
/** 注意: app.isPackaged 可能被被某些方法改变所以请将该文件放到 main.js 必须位于非依赖项的顶部 */
import fixPath from 'fix-path'

import { app } from 'electron'

if (process.platform === 'darwin') {
fixPath()
}

process.env.IS_PACKAGED = JSON.stringify(app.isPackaged)

process.env.DESKTOP_PATH = app.getPath('desktop')
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"electron-store": "^8.1.0",
"electron-updater": "^6.1.4",
"element-plus": "^2.4.0",
"fix-path": "^4.0.0",
"fs-extra": "^11.1.1",
"lodash-es": "^4.17.21",
"pinia": "^2.1.7",
Expand Down
43 changes: 43 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2352593

Please sign in to comment.