YesPlayMusic/packages/electron/preload.ts

12 lines
367 B
TypeScript
Raw Normal View History

2022-04-16 13:30:25 +08:00
import log from './log'
2022-03-19 17:03:29 +08:00
import path from 'path'
import { app } from 'electron'
import { createDirIfNotExist, isDev } from './utils'
2022-03-19 17:03:29 +08:00
if (isDev) {
2022-05-12 02:45:43 +08:00
const devUserDataPath = path.resolve(process.cwd(), '../../tmp/userData')
2022-04-02 00:45:20 +08:00
createDirIfNotExist(devUserDataPath)
2022-03-19 17:03:29 +08:00
app.setPath('appData', devUserDataPath)
}
2022-04-16 13:30:25 +08:00
log.info(`[index] userData path: ${app.getPath('userData')}`)