Skip to content

Commit

Permalink
103: Check for available profile
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyiliev committed Oct 27, 2023
1 parent da3f5a4 commit 7e1c620
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ export function activate(vsContext: vscode.ExtensionContext) {
// Register the `Run SQL` command.
let runDisposable = vscode.commands.registerCommand('materialize.run', async () => {
console.log("[RunSQLCommand]", "Firing detected.");

// Check for available profile before proceeding.
if (!context.getProfileName()) {
vscode.window.showErrorMessage('No available profile to run the query.');
return;
}

const activeEditor = vscode.window.activeTextEditor;
if (!activeEditor) {
vscode.window.showErrorMessage('No active editor.');
Expand Down

0 comments on commit 7e1c620

Please sign in to comment.