mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 17:23:10 -05:00
Verbose output for autorest, displaying output pane on error (#17308)
This commit is contained in:
@@ -425,7 +425,7 @@ export const autorestPostDeploymentScriptName = 'PostDeploymentScript.sql';
|
||||
export const nodeButNotAutorestFound = localize('nodeButNotAutorestFound', "Autorest tool not found in system path, but found Node.js. Running via npx. Please execute 'npm install autorest -g' to install permanently.");
|
||||
export const nodeNotFound = localize('nodeNotFound', "Neither autorest nor Node.js (npx) found in system path. Please install Node.js for autorest generation to work.");
|
||||
export const selectSpecFile = localize('selectSpecFile', "Select OpenAPI/Swagger spec file");
|
||||
export function generatingProjectFailed(errorMessage: string) { return localize('generatingProjectFailed', "Generating project via AutoRest failed: {0}", errorMessage); }
|
||||
export function generatingProjectFailed(errorMessage: string) { return localize('generatingProjectFailed', "Generating project via AutoRest failed. Check output pane for more details. Error: {0}", errorMessage); }
|
||||
export function multipleMostDeploymentScripts(count: number) { return localize('multipleMostDeploymentScripts', "Unexpected number of {0} files: {1}", autorestPostDeploymentScriptName, count); }
|
||||
export const specSelectionText = localize('specSelectionText', "OpenAPI/Swagger spec");
|
||||
|
||||
|
||||
@@ -967,6 +967,7 @@ export class ProjectsController {
|
||||
return project;
|
||||
} catch (err) {
|
||||
void vscode.window.showErrorMessage(constants.generatingProjectFailed(utils.getErrorMessage(err)));
|
||||
this._outputChannel.show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ describe('Autorest tests', function (): void {
|
||||
});
|
||||
|
||||
it('Should construct a correct autorest command for project generation', async function (): Promise<void> {
|
||||
const expectedOutput = 'autorest --use:autorest-sql-testing@latest --input-file="/some/path/test.yaml" --output-folder="/some/output/path" --clear-output-folder';
|
||||
const expectedOutput = 'autorest --use:autorest-sql-testing@latest --input-file="/some/path/test.yaml" --output-folder="/some/output/path" --clear-output-folder --verbose';
|
||||
|
||||
const autorestHelper = new AutorestHelper(testContext.outputChannel);
|
||||
const constructedCommand = autorestHelper.constructAutorestCommand((await autorestHelper.detectInstallation())!, '/some/path/test.yaml', '/some/output/path');
|
||||
|
||||
@@ -101,6 +101,6 @@ export class AutorestHelper extends ShellExecutionHelper {
|
||||
*/
|
||||
public constructAutorestCommand(executable: string, specPath: string, outputFolder: string): string {
|
||||
// TODO: should --clear-output-folder be included? We should always be writing to a folder created just for this, but potentially risky
|
||||
return `${executable} --use:${autorestPackageName}@${this.autorestSqlPackageVersion} --input-file="${specPath}" --output-folder="${outputFolder}" --clear-output-folder`;
|
||||
return `${executable} --use:${autorestPackageName}@${this.autorestSqlPackageVersion} --input-file="${specPath}" --output-folder="${outputFolder}" --clear-output-folder --verbose`;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user