mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 11:56:36 +08:00
feat: use fs/promise instead fs
promise instead fs
This commit is contained in:
parent
302bea9718
commit
1a18501a34
@ -1,4 +1,4 @@
|
|||||||
import { lstat } from 'fs'
|
import { lstat } from 'fs/promises'
|
||||||
import { cwd } from 'process'
|
import { cwd } from 'process'
|
||||||
import { ipcRenderer } from 'electron'
|
import { ipcRenderer } from 'electron'
|
||||||
|
|
||||||
@ -7,10 +7,8 @@ ipcRenderer.on('main-process-message', (_event, ...args) => {
|
|||||||
console.log('[Receive Main-process message]:', ...args)
|
console.log('[Receive Main-process message]:', ...args)
|
||||||
})
|
})
|
||||||
|
|
||||||
lstat(cwd(), (err, stats) => {
|
lstat(cwd()).then(stats => {
|
||||||
if (err) {
|
console.log('[fs.lstat]', stats)
|
||||||
console.log(err)
|
}).catch(err => {
|
||||||
} else {
|
console.error(err)
|
||||||
console.log('[fs.lstat]', stats)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user