Manual azdata installation/upgrade using Readme (#12023)

* code complete

* string fixes

* show logger

* pr feedback
This commit is contained in:
Arvind Ranasaria
2020-08-31 12:50:10 -07:00
committed by GitHub
parent 61e5003931
commit 7495259e13
4 changed files with 34 additions and 14 deletions

View File

@@ -4,23 +4,16 @@
*--------------------------------------------------------------------------------------------*/
import * as azdataExt from 'azdata-ext';
import * as vscode from 'vscode';
import { checkAndUpgradeAzdata, findAzdata, IAzdataTool } from './azdata';
import { findAzdata, IAzdataTool, manuallyInstallOrUpgradeAzdata } from './azdata';
import * as loc from './localizedConstants';
let localAzdata: IAzdataTool | undefined = undefined;
export async function activate(): Promise<azdataExt.IExtension> {
localAzdata = await checkForAzdata();
// Don't block on this since we want the extension to finish activating without needing user input
// upgrade if available and user wants it.
checkAndUpgradeAzdata(localAzdata)
.then(async upgradePerformed => {
if (upgradePerformed) { // If upgrade was performed then find and save the new azdata
localAzdata = await findAzdata();
}
})
.catch(err => vscode.window.showWarningMessage(loc.upgradeError(err)));
// Don't block on this since we want the extension to finish activating without user actions
manuallyInstallOrUpgradeAzdata(localAzdata)
.catch(err => console.log(err));
return {
azdata: {
arc: {