@@ -203,7 +203,7 @@ export const registerIpcMainHandlers = () => {
203203 const lastDir = storage . get ( ) . app . lastExportDir || storage . get ( ) . app . exportDir ;
204204
205205 if ( files . length === 1 && ! files [ 0 ] . name . includes ( path . sep ) ) {
206- const originalFileName = files [ 0 ] . name ;
206+ const originalFileName = files [ 0 ] . name . replace ( / \/ / g , "-" ) ;
207207 const savePath = await dialogs . showSaveDialog ( {
208208 defaultPath : `${ lastDir } /${ path . basename ( originalFileName ) } ` ,
209209 showsTagField : false ,
@@ -239,7 +239,7 @@ export const registerIpcMainHandlers = () => {
239239 directoryPath = path . resolve ( directoryPath ) ;
240240 let filesToBeReplaced = 0 ;
241241 for ( const file of files ) {
242- const outputPath = path . join ( directoryPath , file . name ) ;
242+ const outputPath = path . join ( directoryPath , file . name . replace ( / \/ / g , "-" ) ) ;
243243 const validExtensions = [ ".fig" , ".jpg" , ".pdf" , ".png" , ".svg" ] ;
244244 if (
245245 path . relative ( directoryPath , outputPath ) . startsWith ( ".." ) ||
@@ -277,7 +277,7 @@ export const registerIpcMainHandlers = () => {
277277 }
278278 }
279279 for ( const file of files ) {
280- const outputPath = path . join ( directoryPath , file . name ) ;
280+ const outputPath = path . join ( directoryPath , file . name . replace ( / \/ / g , "-" ) ) ;
281281 mkPath ( path . dirname ( outputPath ) ) ;
282282
283283 try {
0 commit comments