mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2025-03-01 11:52:12 +08:00
20 lines
454 B
TypeScript
20 lines
454 B
TypeScript
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(`[preload] userData path: ${app.getPath('userData')}`)
|