Skip to content

Commit f899b75

Browse files
committed
Also migrate local-settings.json
1 parent 9424275 commit f899b75

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/cs.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,13 +550,21 @@ export class CodeSync {
550550
let tmpExtension = helpers.getFolderExtensionInfo(f);
551551
if (tmpExtension.id == 'golf1052.code-sync') {
552552
if (tmpExtension.id == 'golf1052.code-sync' && helpers.isVersionGreaterThan(currentVersion, tmpExtension.version) == 1) {
553+
this.logger.appendLine(`Migrating stuff. Previous version: ${tmpExtension.version}. Current version: ${currentVersion}.`);
553554
if (fs.existsSync(path.join(this.vsCodeExtensionDir, f, SETTINGS))) {
554-
this.logger.appendLine(`Migrating settings. Previous version: ${tmpExtension.version}. Current version: ${currentVersion}.`);
555+
this.logger.appendLine(`Migrating settings.`);
555556
let oldSettings = path.join(this.vsCodeExtensionDir, f, SETTINGS);
556557
let newSettings = path.join(codeSyncExtensionDir, SETTINGS);
557558
this.logger.appendLine(`Previous file: ${oldSettings}. New file: ${newSettings}.`)
558559
await helpers.copy(oldSettings, newSettings);
559560
}
561+
if (fs.existsSync(path.join(this.vsCodeExtensionDir, f, LOCAL_SETTINGS))) {
562+
this.logger.appendLine(`Migrating local settings.`);
563+
let oldLocalSettings = path.join(this.vsCodeExtensionDir, f, LOCAL_SETTINGS);
564+
let newLocalSettings = path.join(codeSyncExtensionDir, LOCAL_SETTINGS);
565+
this.logger.appendLine(`Previous file: ${oldLocalSettings}. New file: ${newLocalSettings}.`);
566+
await helpers.copy(oldLocalSettings, newLocalSettings);
567+
}
560568
}
561569
}
562570
}

0 commit comments

Comments
 (0)