mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 01:25:36 -05:00
Adds autorest-based SQL Project generation to SQL Database Projects extension (#17078)
* Initial changes * checkpoint * Constructing project with post deployment script * Correcting to intentionally read from cached list of projects * Adding activation event, fixing fresh workspace bug * Convert netcoreTool and autorestHelper to share a helper class for streamed command * Include npm package version to force update * test checkpoint * Unit tests * Added contextual quickpicks for autorest dialogs * Adding projectController test * Added projectController test, some refactoring for testability * Merge branch 'main' into benjin/autorest * Fixing 'which' import * PR feedback * Fixing tests * Adding additional information for when project provider tests fail * Hopefully fixing failing tests (unable to repro locally) * Adding Generate Project item to workspace menu * PR feedback
This commit is contained in:
@@ -12,10 +12,11 @@ import * as glob from 'fast-glob';
|
||||
import * as dataworkspace from 'dataworkspace';
|
||||
import * as mssql from '../../../mssql';
|
||||
import * as vscodeMssql from 'vscode-mssql';
|
||||
import { promises as fs } from 'fs';
|
||||
import { Project } from '../models/project';
|
||||
import * as childProcess from 'child_process';
|
||||
import * as fse from 'fs-extra';
|
||||
import * as which from 'which';
|
||||
import { promises as fs } from 'fs';
|
||||
import { Project } from '../models/project';
|
||||
|
||||
export interface ValidationResult {
|
||||
errorMessage: string;
|
||||
@@ -489,6 +490,23 @@ export async function retry<T>(
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects whether the specified command-line command is available on the current machine
|
||||
*/
|
||||
export async function detectCommandInstallation(command: string): Promise<boolean> {
|
||||
try {
|
||||
const found = await which(command);
|
||||
|
||||
if (found) {
|
||||
return true;
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(getErrorMessage(err));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all the projects of the specified extension in the folder
|
||||
* @param folder
|
||||
|
||||
Reference in New Issue
Block a user