mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 21:58:03 +00:00
feat: 解决build bug
This commit is contained in:
parent
46fe2d734e
commit
e99c4833f7
47 changed files with 1236 additions and 611 deletions
14
src/main/utils.ts
Normal file
14
src/main/utils.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import fs from 'fs'
|
||||
|
||||
export const createDirIfNotExist = (dir: string) => {
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir, { recursive: true })
|
||||
}
|
||||
}
|
||||
|
||||
export const createFileIfNotExist = (file: string) => {
|
||||
createDirIfNotExist(file.split('/').slice(0, -1).join('/'))
|
||||
if (!fs.existsSync(file)) {
|
||||
fs.writeFileSync(file, '')
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue