mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
chore: 整理electron目录
This commit is contained in:
parent
ca4725a46e
commit
8d7ae405a6
15 changed files with 160 additions and 68 deletions
19
packages/electron/main/preload.ts
Normal file
19
packages/electron/main/preload.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import log from './log'
|
||||
import { app } from 'electron'
|
||||
import {
|
||||
createDirIfNotExist,
|
||||
devUserDataPath,
|
||||
isDev,
|
||||
portableUserDataPath,
|
||||
} from './utils'
|
||||
|
||||
if (isDev) {
|
||||
createDirIfNotExist(devUserDataPath)
|
||||
app.setPath('appData', devUserDataPath)
|
||||
}
|
||||
if (process.env.PORTABLE_EXECUTABLE_DIR) {
|
||||
createDirIfNotExist(portableUserDataPath)
|
||||
app.setPath('appData', portableUserDataPath)
|
||||
}
|
||||
|
||||
log.info(`[index] userData path: ${app.getPath('userData')}`)
|
||||
Loading…
Add table
Add a link
Reference in a new issue