File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -2077,9 +2077,9 @@ class ElectronLoader {
20772077
20782078 // Backup any existing plugins file
20792079 if ( fs . existsSync ( pluginListPath ) ) {
2080- const backupFile = `${ pluginListPath } .sml_bak` ;
2081- if ( fs . existsSync ( backupFile ) ) {
2082- fs . moveSync ( backupFile , ` ${ backupFile } _${ this . #currentDateTimeAsFileName( ) } `) ;
2080+ let backupFile = `${ pluginListPath } .sml_bak` ;
2081+ while ( fs . existsSync ( backupFile ) ) {
2082+ backupFile += ` _${ this . #currentDateTimeAsFileName( ) } `;
20832083 }
20842084
20852085 fs . copyFileSync ( pluginListPath , backupFile ) ;
@@ -2126,7 +2126,12 @@ class ElectronLoader {
21262126
21272127 // Backup any existing config files
21282128 if ( fs . existsSync ( configDestPath ) ) {
2129- fs . moveSync ( configDestPath , path . join ( backupDir , configFileName ) ) ;
2129+ let backupFile = path . join ( backupDir , configFileName ) ;
2130+ while ( fs . existsSync ( backupFile ) ) {
2131+ backupFile += `_${ this . #currentDateTimeAsFileName( ) } ` ;
2132+ }
2133+
2134+ fs . moveSync ( configDestPath , backupFile ) ;
21302135 }
21312136
21322137 await fs . copyFile ( configSrcPath , configDestPath ) ;
You can’t perform that action at this time.
0 commit comments