diff --git a/CHANGELOG.md b/CHANGELOG.md index ae52ab6..b91fb31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to the "vscode-backup" extension will be documented in this ## Release Notes +### 0.0.6 + +Multi-Pltform Backup/Restore +Backup package from one platform can be used to restore on another platform. + ### 0.0.5 Linux Support Added diff --git a/README.md b/README.md index 492edb6..71adcb5 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Or can be accessed manually with the folowing commands: ### Failed to Install Extension -Some Extensions in visual studio marketplace has different package id then what they register in system after install. Sice this plugin doesn't copy any existing extension file from one system to anoteher for privacy and security reasons and install everything from marketplace in the new system, some extensions might fail to install in the newer system if they have different package id in the marketplace. e.g. `ms-vscode.csharp` has the id `ms-dotnettools.csharp` in the marketplace. +Some Extensions in visual studio marketplace has different package id than what they register in system after install. Sice this plugin doesn't copy any existing extension file from one system to anoteher for privacy and security reasons and install everything from marketplace in the new system, some extensions might fail to install in the newer system if they have different package id in the marketplace. e.g. `ms-vscode.csharp` has the id `ms-dotnettools.csharp` in the marketplace. Workaround: Check the output log and install the failed to install extensions manually @@ -69,6 +69,11 @@ Build: `npm run build` ## Release Notes +### 0.0.6 + +Multi-Pltform Backup/Restore +Backup package from one platform can be used to restore on another platform. + ### 0.0.5 Linux Support Added diff --git a/extension.js b/extension.js index 1751034..6699f03 100644 --- a/extension.js +++ b/extension.js @@ -50,7 +50,7 @@ function activate(context) { ps.addCommand('code --list-extensions | % { "code --install-extension $_ " }'); ps.invoke() .then(output => { - fs.writeFile(path.join(folderPath, 'plugins.ps1'), output, error => { + fs.writeFile(path.join(folderPath, 'plugins'), output, error => { if(error) { Output.appendLine(error.toString()); vscode.window.showErrorMessage('Failed to create backup file'); @@ -67,7 +67,7 @@ function activate(context) { } else { sh.exec('code --list-extensions | xargs -L 1 echo code --install-extension', (code, output) => { - fs.writeFile(path.join(folderPath, 'plugins.sh'), output, error => { + fs.writeFile(path.join(folderPath, 'plugins'), output, error => { if(error) { Output.appendLine(error.toString()); vscode.window.showErrorMessage('Failed to create backup file'); @@ -93,11 +93,11 @@ function activate(context) { }); child.stderr.on("data",function(data){ Output.appendLine("Errors: " + data); - vscode.window.showErrorMessage('Some Hiccups while Installing Extaintions. Check Output for Details'); + vscode.window.showErrorMessage('Some Hiccups while Installing Extensions. Check Output for Details'); }); child.on("exit",function(){ Output.appendLine("Script finished"); - vscode.window.showInformationMessage('Extaintions Imported. Check Output for Details'); + vscode.window.showInformationMessage('Extensions Imported. Check Output for Details'); }); child.stdin.end(); //end input } @@ -109,11 +109,11 @@ function activate(context) { }); child.stderr.on("data",function(data){ Output.appendLine("Errors: " + data); - vscode.window.showErrorMessage('Some Hiccups while Installing Extaintions. Check Output for Details'); + vscode.window.showErrorMessage('Some Hiccups while Installing Extensions. Check Output for Details'); }); child.on("exit",function(){ Output.appendLine("Script finished"); - vscode.window.showInformationMessage('Extaintions Imported. Check Output for Details'); + vscode.window.showInformationMessage('Extensions Imported. Check Output for Details'); }); child.stdin.end(); //end input } @@ -150,15 +150,9 @@ function archive(mode = 'create') { //implemet node-zip after mac test if(mode === 'create') { // @ts-ignore var zip = new require('node-zip')(); - if(process.platform === 'win32') { - zip.file('plugins.ps1', fs.readFileSync(path.join(folderPath, 'plugins.ps1'))); - } - else if(process.platform === 'darwin') { - zip.file('plugins.sh', fs.readFileSync(path.join(folderPath, 'plugins.sh'))); - } - else { - zip.file('plugins.sh', fs.readFileSync(path.join(folderPath, 'plugins.sh'))); - } + + zip.file('plugins', fs.readFileSync(path.join(folderPath, 'plugins'))); + if(fs.existsSync(path.join(folderPath, 'settings.json'))) { zip.file('settings.json', fs.readFileSync(path.join(folderPath, 'settings.json'))); } @@ -217,13 +211,13 @@ function archive(mode = 'create') { //implemet node-zip after mac test } if(process.platform === 'win32') { - fs.writeFileSync(path.join(folderPath, 'plugins.ps1'), zip.files['plugins.ps1']._data); + fs.writeFileSync(path.join(folderPath, 'plugins.ps1'), zip.files['plugins']._data); } else if(process.platform === 'darwin') { - fs.writeFileSync(path.join(folderPath, 'plugins.sh'), zip.files['plugins.sh']._data); + fs.writeFileSync(path.join(folderPath, 'plugins.sh'), zip.files['plugins']._data); } else { - fs.writeFileSync(path.join(folderPath, 'plugins.sh'), zip.files['plugins.sh']._data); + fs.writeFileSync(path.join(folderPath, 'plugins.sh'), zip.files['plugins']._data); } vscode.window.showWarningMessage('Installing Plugins. Do Not Close the Window. Check Output log for details.'); diff --git a/package.json b/package.json index 7c04e46..62e04bb 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "color": "#101010", "theme": "dark" }, - "version": "0.0.5", + "version": "0.0.6", "engines": { "vscode": "^1.41.0" },