mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Switched fs.renameSync to fs.copyFileSync
This commit is contained in:
@@ -286,12 +286,14 @@ async function migrateUserData() {
|
||||
// Copy the file to the new location
|
||||
fs.cpSync(migration.old, migration.new, { force: true });
|
||||
// Move the file to the backup location
|
||||
fs.renameSync(migration.old, path.join(backupDirectory, path.basename(migration.old)));
|
||||
fs.cpSync(migration.old, path.join(backupDirectory, path.basename(migration.old)));
|
||||
fs.rmSync(migration.old, { recursive: true, force: true });
|
||||
} else {
|
||||
// Copy the directory to the new location
|
||||
fs.cpSync(migration.old, migration.new, { recursive: true, force: true });
|
||||
// Move the directory to the backup location
|
||||
fs.renameSync(migration.old, path.join(backupDirectory, path.basename(migration.old)));
|
||||
fs.cpSync(migration.old, path.join(backupDirectory, path.basename(migration.old)));
|
||||
fs.rmSync(migration.old, { recursive: true, force: true });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(color.red(`Error migrating ${migration.old} to ${migration.new}:`), error.message);
|
||||
|
Reference in New Issue
Block a user