@@ -11,14 +11,54 @@ export function activate(context: vscode.ExtensionContext) {
1111 const baseUrl = "https://raw.githubusercontent.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/master/" ;
1212
1313
14+ // checking spblitz versioning
15+ var oediag = async ( context : sqlops . ObjectExplorerContext ) => {
16+ vscode . window . showInformationMessage ( context . isConnectionNode . toString ( ) ) ;
17+ vscode . window . showInformationMessage ( context . nodeInfo . label ) ;
18+ vscode . window . showInformationMessage ( context . nodeInfo . nodePath ) ;
19+ } ;
20+ var disposable_oediag = vscode . commands . registerCommand ( 'extension.OEdiagnostics' , oediag ) ;
21+ context . subscriptions . push ( disposable_oediag ) ;
22+
1423 // checking spblitz versioning
1524 var getblitzversion = async ( context : sqlops . ObjectExplorerContext ) => {
16- new updatecheck ( ) . checkForUpdates ( context ) ;
25+ var amIUPD = new updatecheck ( ) ;
26+ let updateReturn = await amIUPD . checkForUpdates ( context ) ;
27+
28+ // updateChoice.then(function(updateReturn) {
29+ // if (updateReturn) {
30+ vscode . window . showInformationMessage ( updateReturn ) ;
31+ if ( updateReturn == 'update' ) {
32+ getblitzall ( ) ;
33+ } else if ( updateReturn != '' ) {
34+ let versionURL = 'https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/releases/tag/' + updateReturn ;
35+ vscode . commands . executeCommand ( 'vscode.open' , vscode . Uri . parse ( versionURL ) ) ;
36+ } else {
37+ // do nothing
38+ vscode . window . showInformationMessage ( "nothing came back" ) ;
39+ }
40+ // }
41+ // });
1742 } ;
1843 var disposable_spblitzversion = vscode . commands . registerCommand ( 'extension.sp_blitzversion' , getblitzversion ) ;
1944 context . subscriptions . push ( disposable_spblitzversion ) ;
2045
21- //importing the full spblitz script
46+
47+ //importing all first responder kit scripts
48+ var getblitzall = async ( ) => {
49+ let fileName = "Install-All-Scripts.sql" ;
50+ var options = {
51+ uri : baseUrl + fileName ,
52+ } ;
53+ console . log ( 'Bringing in the first responder kit from the mothership.' ) ;
54+ const scriptText = await request . get ( options ) ;
55+ //await placeScript.placescript(fileName, scriptText);
56+ new placeScript ( ) . placescript ( fileName , scriptText ) ;
57+ } ;
58+ var disposable_spblitzall = vscode . commands . registerCommand ( 'extension.sp_blitzall' , getblitzall ) ;
59+ context . subscriptions . push ( disposable_spblitzall ) ;
60+
61+ //importing the original spblitz script
2262 var getblitz = async ( ) => {
2363 let fileName = "sp_Blitz.sql" ;
2464 var options = {
0 commit comments