@@ -76,12 +76,9 @@ if (mainWindow) {
76
76
//{ filePaths } destructured comes fromdialog.showOpenDialog() function.
77
77
const { filePaths } = await dialog . showOpenDialog ( mainWindow , options ) ;
78
78
79
- console . log ( "filePaths from main is" , filePaths ) ;
80
79
if ( ! filePaths ) return ;
81
80
const readData = await fs . readFileSync ( filePaths [ 0 ] , "utf8" ) ;
82
- console . log ( "readData is" , readData ) ;
83
81
const jsonFile = JSON . parse ( readData ) ;
84
- console . log ( "jsonFile is" , jsonFile ) ;
85
82
return { jsonFile } ;
86
83
}
87
84
} ) ;
@@ -110,16 +107,14 @@ ipcMain.handle("exportComponent", async (event, options) => {
110
107
111
108
112
109
ipcMain . handle ( 'writeFile' , async ( event , filePath , content ) => { //possibly merge this with 'writeJSON' handle
113
- // console.log('writeFile filePath:', filePath, '\n content:', content);
114
- console . log ( "writeFile filePath:" , filePath ) ;
110
+
115
111
await fs . writeFile ( filePath , content , ( err ) => {
116
112
if ( err ) {
117
113
console . log ( `${ err } in fs.writeFile` ) ;
118
114
} else {
119
115
console . log ( "File written successfully" ) ;
120
116
}
121
117
} ) ;
122
- console . log ( 'finished fs.writeSync' )
123
118
return { status : "success" } ;
124
119
125
120
} ) ;
@@ -128,16 +123,13 @@ ipcMain.handle('writeFile', async (event, filePath, content) => { //possibly mer
128
123
129
124
ipcMain . handle ( 'check-file-exists' , async ( event , path ) => {
130
125
const fileExists = await fs . existsSync ( path ) ;
131
- console . log ( "fileExists" , fileExists ) ;
132
126
if ( fileExists ) return { status : true } ;
133
127
return { status : false } ;
134
128
} ) ;
135
129
136
130
ipcMain . handle ( 'mkdirSync' , async ( event , args : string [ ] ) => {
137
131
const mkdirPath = await path . join ( ...args ) ;
138
- console . log ( "mkdirPath" , mkdirPath ) ;
139
132
await fs . mkdirSync ( mkdirPath ) ;
140
- console . log ( "finished making new directory" ) ;
141
133
return { status : 'success' } ;
142
134
} ) ;
143
135
0 commit comments