@@ -67,16 +67,14 @@ ipcMain.handle('ilist-files', async (event, folder) => {
67
67
return ilistFolder ( folder )
68
68
} )
69
69
70
- ipcMain . handle ( 'load-file' , ( event , folder , filename ) => {
71
- console . log ( 'ipcMain' , 'load-file' , folder , filename )
72
- let filePath = path . resolve ( folder , filename )
70
+ ipcMain . handle ( 'load-file' , ( event , filePath ) => {
71
+ console . log ( 'ipcMain' , 'load-file' , filePath )
73
72
let content = fs . readFileSync ( filePath )
74
73
return content
75
74
} )
76
75
77
- ipcMain . handle ( 'save-file' , ( event , folder , filename , content ) => {
78
- console . log ( 'ipcMain' , 'save-file' , folder , filename , content )
79
- let filePath = path . resolve ( folder , filename )
76
+ ipcMain . handle ( 'save-file' , ( event , filePath , content ) => {
77
+ console . log ( 'ipcMain' , 'save-file' , filePath , content )
80
78
fs . writeFileSync ( filePath , content , 'utf8' )
81
79
return true
82
80
} )
@@ -92,9 +90,8 @@ ipcMain.handle('update-folder', (event, folder) => {
92
90
return { folder, files }
93
91
} )
94
92
95
- ipcMain . handle ( 'remove-file' , ( event , folder , filename ) => {
96
- console . log ( 'ipcMain' , 'remove-file' , folder , filename )
97
- let filePath = path . resolve ( folder , filename )
93
+ ipcMain . handle ( 'remove-file' , ( event , filePath ) => {
94
+ console . log ( 'ipcMain' , 'remove-file' , filePath )
98
95
fs . unlinkSync ( filePath )
99
96
return true
100
97
} )
@@ -107,13 +104,6 @@ ipcMain.handle('rename-file', (event, folder, filename, newFilename) => {
107
104
return newFilename
108
105
} )
109
106
110
- ipcMain . handle ( 'clean-path' , ( event , filePath ) => {
111
- console . log ( 'ipcMain' , 'cleanPath' , filePath )
112
- const resolvedPath = cleanPath ( filePath )
113
- console . log ( 'resolved path' , resolvedPath )
114
- return resolvedPath
115
- } )
116
-
117
107
// WINDOW MANAGEMENT
118
108
119
109
ipcMain . handle ( 'set-window-size' , ( event , minWidth , minHeight ) => {
0 commit comments