diff --git a/extensions/sql-database-projects/src/common/constants.ts b/extensions/sql-database-projects/src/common/constants.ts index 8fb71ff3d4..eea66c2aba 100644 --- a/extensions/sql-database-projects/src/common/constants.ts +++ b/extensions/sql-database-projects/src/common/constants.ts @@ -170,8 +170,8 @@ export const dockerContainerNotRunningErrorMessage = localize('dockerContainerNo export const dockerContainerFailedToRunErrorMessage = localize('dockerContainerFailedToRunErrorMessage', "Failed to run the docker container"); export const connectingToSqlServerOnDockerMessage = localize('connectingToSqlServerOnDockerMessage', "Connecting to SQL Server on Docker"); export const deployProjectFailedMessage = localize('deployProjectFailedMessage', "Failed to open a connection to the deployed database'"); -export const containerAlreadyExistForProject = localize('containerAlreadyExistForProject', "Other servers on container already exist for the project. Do you want to delete them?'"); -export const checkoutOutputMessage = localize('checkoutOutputMessage', "Check output pane for more details."); +export const containerAlreadyExistForProject = localize('containerAlreadyExistForProject', "Other servers on container already exist for the project. Do you want to delete them?"); +export const checkoutOutputMessage = localize('checkoutOutputMessage', "Check output pane for more details"); export function taskFailedError(taskName: string, err: string): string { return localize('taskFailedError.error', "Failed to complete task '{0}'. Error: {1}", taskName, err); } export function publishToContainerFailed(errorMessage: string) { return localize('publishToContainerFailed', "Failed to publish to container. {0}", errorMessage); } export function deployAppSettingUpdateFailed(appSetting: string) { return localize('deployAppSettingUpdateFailed', "Failed to update app setting '{0}'", appSetting); } diff --git a/extensions/sql-database-projects/src/common/utils.ts b/extensions/sql-database-projects/src/common/utils.ts index 4a028a6a59..20e453d79f 100644 --- a/extensions/sql-database-projects/src/common/utils.ts +++ b/extensions/sql-database-projects/src/common/utils.ts @@ -561,14 +561,14 @@ export function isValidSQLPassword(password: string, userName: string = 'sa'): b export async function showErrorMessageWithOutputChannel(errorMessageFunc: (error: string) => string, error: any, outputChannel: vscode.OutputChannel): Promise { const result = await vscode.window.showErrorMessage(errorMessageFunc(getErrorMessage(error)), constants.checkoutOutputMessage); - if (result !== undefined) { + if (result === constants.checkoutOutputMessage) { outputChannel.show(); } } export async function showInfoMessageWithOutputChannel(message: string, outputChannel: vscode.OutputChannel): Promise { const result = await vscode.window.showInformationMessage(message, constants.checkoutOutputMessage); - if (result !== undefined) { + if (result === constants.checkoutOutputMessage) { outputChannel.show(); } } diff --git a/extensions/sql-database-projects/src/models/deploy/deployService.ts b/extensions/sql-database-projects/src/models/deploy/deployService.ts index 4119c962d7..84edc05178 100644 --- a/extensions/sql-database-projects/src/models/deploy/deployService.ts +++ b/extensions/sql-database-projects/src/models/deploy/deployService.ts @@ -238,7 +238,7 @@ export class DeployService { providerName: 'MSSQL', saveProfile: false, id: '', - connectionName: `${profile.profileName}`, + connectionName: profile.profileName, options: [], authenticationType: 'SqlLogin' }; @@ -401,13 +401,9 @@ RUN ["/bin/bash", "/opt/commands/start.sh"] await fse.writeFile(filePath, content); } - private async getCurrentIds(commandToRun: string): Promise { - const currentIds = await utils.executeCommand(commandToRun, this._outputChannel); - return currentIds ? currentIds.split(/\r?\n/) : []; - } - public async getCurrentDockerContainer(imageLabel: string): Promise { - return await this.getCurrentIds(`docker ps -q -a --filter label=${imageLabel}`); + const currentIds = await utils.executeCommand(`docker ps -q -a --filter label=${imageLabel}`, this._outputChannel); + return currentIds ? currentIds.split(/\r?\n/) : []; } public async cleanDockerObjects(ids: string[], commandsToClean: string[]): Promise {