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 { ipcRenderer } from 'electron'
|
||||
|
||||
@ -7,10 +7,8 @@ ipcRenderer.on('main-process-message', (_event, ...args) => {
|
||||
console.log('[Receive Main-process message]:', ...args)
|
||||
})
|
||||
|
||||
lstat(cwd(), (err, stats) => {
|
||||
if (err) {
|
||||
console.log(err)
|
||||
} else {
|
||||
console.log('[fs.lstat]', stats)
|
||||
}
|
||||
lstat(cwd()).then(stats => {
|
||||
console.log('[fs.lstat]', stats)
|
||||
}).catch(err => {
|
||||
console.error(err)
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user